Initial Commit
This commit is contained in:
254
pages/my/shops/shops.js
Normal file
254
pages/my/shops/shops.js
Normal file
@ -0,0 +1,254 @@
|
||||
// pages/my/my_order/my_order.js
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
bgImg: app.globalData.bgImg,
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
type: 1,
|
||||
typeXz: 142.5,
|
||||
page: 1,
|
||||
num: 10,
|
||||
orderList: []
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
// 登录
|
||||
wx.getStorage({
|
||||
key: 'user',
|
||||
success: data => {
|
||||
this.setData({
|
||||
userData: data.data,
|
||||
login: true,
|
||||
})
|
||||
console.log('身份', this.data.userData)
|
||||
},
|
||||
})
|
||||
if (options.state) {
|
||||
console.log(options.state)
|
||||
var type = options.state
|
||||
var typeXz = 142.5 + parseInt(type) * 375
|
||||
this.setData({
|
||||
type: type,
|
||||
typeXz: typeXz,
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//返回
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
wx.getStorage({
|
||||
key: 'user',
|
||||
success: user => {
|
||||
this.setData({
|
||||
storesId: user.data.wisdStores.id,
|
||||
page: 1,
|
||||
orderList: []
|
||||
})
|
||||
this.orderList();
|
||||
},
|
||||
fail: e => {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
//订单数据
|
||||
orderList: function () {
|
||||
console.log(11111)
|
||||
wx.showLoading({
|
||||
title: '加载中..',
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/user/getMerchantsStores',
|
||||
method: 'GET',
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {
|
||||
userId: app.globalData.userId,
|
||||
storesId: this.data.storesId,
|
||||
type: this.data.type,
|
||||
page: this.data.page,
|
||||
num: this.data.num
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
if (res.data.value.records.length > 0) {
|
||||
var orderList = this.data.orderList;
|
||||
for (var i = 0; i < res.data.value.records.length; i++) {
|
||||
orderList.push(res.data.value.records[i])
|
||||
}
|
||||
this.setData({
|
||||
orderList: orderList,
|
||||
page: this.data.page + 1
|
||||
})
|
||||
} else {
|
||||
if (this.data.page != 1) {
|
||||
wx.showToast({
|
||||
title: '暂无更多~',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//type
|
||||
type: function (e) {
|
||||
var type = e.currentTarget.dataset.type;
|
||||
var typeXz = 142.5 + (parseInt(type) - 1) * 375
|
||||
this.setData({
|
||||
type: type,
|
||||
typeXz: typeXz,
|
||||
page: 1,
|
||||
orderList: []
|
||||
})
|
||||
this.orderList();
|
||||
},
|
||||
|
||||
|
||||
|
||||
//确认收货
|
||||
confirm: function (e) {
|
||||
wx.showModal({
|
||||
title: '提示!',
|
||||
content: '确认客户已提货吗?',
|
||||
success: s => {
|
||||
if (s.confirm) {
|
||||
wx.showLoading({
|
||||
title: '加载中..',
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/order/confirmOrder',
|
||||
method: 'POST',
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {
|
||||
orderId: e.currentTarget.dataset.id
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
wx.showToast({
|
||||
title: '操作成功~',
|
||||
icon: 'none',
|
||||
success: ss => {
|
||||
setTimeout(() => {
|
||||
this.setData({
|
||||
page: 1,
|
||||
orderList: [],
|
||||
})
|
||||
this.orderList();
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '确认失败!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
//订单详情
|
||||
toOrderDetail(e) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/order_details/order_details?orderNumber=' + e.currentTarget.dataset.num + '&shops=true',
|
||||
})
|
||||
},
|
||||
|
||||
//二维码扫描
|
||||
scancode: function () {
|
||||
// 允许从相机和相册扫码
|
||||
wx.scanCode({
|
||||
success(res) {
|
||||
console.log(res);
|
||||
let scene = res.result.split(',')
|
||||
console.log(scene)
|
||||
if (scene[0] === 'sjfhjsafsjab&*#$.!') {
|
||||
wx.navigateTo({
|
||||
url: '/pages/order_detailsCode/order_details?id=' + scene[2] + '&orderNumber=' + scene[1],
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '请扫描正确核销码~',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res);
|
||||
wx.showToast({
|
||||
title: '失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
this.orderList()
|
||||
},
|
||||
|
||||
})
|
||||
6
pages/my/shops/shops.json
Normal file
6
pages/my/shops/shops.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarBackgroundColor": "#F37016",
|
||||
"navigationBarTitleText": "商家核销",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
65
pages/my/shops/shops.wxml
Normal file
65
pages/my/shops/shops.wxml
Normal file
@ -0,0 +1,65 @@
|
||||
<!--pages/my/my_order/my_order.wxml-->
|
||||
<view class="top" style="background: url({{bgImg}}shops-top.png) no-repeat;background-size: 100%;">
|
||||
<!-- <view class="title">
|
||||
<image src="/icon/back-w.png" catchtap="back"></image>商家核销
|
||||
</view> -->
|
||||
<view class="top-c display_J_B">
|
||||
<view class="top-c__l">
|
||||
<view class="l-1 GStitleOne">{{userData.wisdStores.storesName}}</view>
|
||||
<view class="l-2 display_J_S">
|
||||
<view class="display_A_C" style="height:55rpx;"><image src="/icon/index-address.png"></image></view>
|
||||
<view class="GStitleTwo" style="width:550rpx;height:110rpx;">
|
||||
{{userData.wisdStores.storesProvince + userData.wisdStores.storesCity + userData.wisdStores.storesArea + userData.wisdStores.storesDetailed}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="top-c__r" ><image src='/icon/code.png' catchtap="scancode"></image></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="typeAll display_J_B">
|
||||
<view class="type {{type==1?'type_xz':''}}" catchtap="type" data-type="1">待核销</view>
|
||||
<view class="type {{type==2?'type_xz':''}}" catchtap="type" data-type="2">已核销</view>
|
||||
<view class="typeXz" style="position: absolute;bottom: 2rpx;left:{{typeXz}}rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view class="orderAll">
|
||||
<view class="order" wx:for="{{orderList}}" wx:key='index' data-num="{{item.orderNumber}}" catchtap="toOrderDetail">
|
||||
<view class="state">{{item.status==4?'已核销':'待核销'}}</view>
|
||||
<view class="number">订单编号:<text>{{item.orderNumber}}</text></view>
|
||||
<view class="number" wx:if="{{item.orderPick==1}}" style="margin-top:20rpx;">
|
||||
提货时间:<text>{{item.orderPickTime==null?'暂无':item.orderPickTime}}</text>
|
||||
</view>
|
||||
<view class="number" style="margin-top:20rpx;">
|
||||
联系方式:<text>{{item.userPhone}}</text>
|
||||
</view>
|
||||
<view class="goods display_J_B" style="margin-top:50rpx;" wx:for="{{item.goodsList}}" wx:for-item="goods" wx:key='index'>
|
||||
<view class="goodsL">
|
||||
<image src="{{goods.goodsPhoto}}"></image>
|
||||
</view>
|
||||
<view class="goodsM">
|
||||
<view class="goodsTitle GStitleTwo">{{goods.goodsName}}</view>
|
||||
<view class="spec">规格:{{goods.wisdGoodsSpec.specName}}</view>
|
||||
<view class="goodsPrice" wx:if='{{item.orderPayWay!=3}}'>¥{{goods.wisdGoodsSpec.specBulyPrice==null?goods.wisdGoodsSpec.specPrice:goods.wisdGoodsSpec.specBulyPrice}}</view>
|
||||
<view class="goodsPrice" wx:if='{{item.orderPayWay==3}}'>¥0</view>
|
||||
</view>
|
||||
<view class="goodsR display_A_E">x <text>{{goods.goodsNum}}</text></view>
|
||||
</view>
|
||||
|
||||
<view class="total display_J_E">
|
||||
<view class="total1">免运费</view>
|
||||
<view class="total3">合计<text>¥{{item.orderActualPay}}</text></view>
|
||||
</view>
|
||||
<!-- <view class="btn display_J_E">
|
||||
<view class="btn1 btn2" wx:if="{{item.status==2}}" data-id='{{item.id}}' catchtap="confirm">确认提货</view>
|
||||
<view class="btn1" wx:if="{{item.status==4}}" catchtap="del" data-id='{{item.id}}' data-index="{{index}}">已提货</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="empty" wx:if="{{orderList.length==0}}">
|
||||
<view class="emptyImg">
|
||||
<image src="/icon/order_none.png"></image>
|
||||
</view>
|
||||
<view class="emptyTitle">暂无订单~</view>
|
||||
</view>
|
||||
242
pages/my/shops/shops.wxss
Normal file
242
pages/my/shops/shops.wxss
Normal file
@ -0,0 +1,242 @@
|
||||
/* pages/my/my_order/my_order.wxss */
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.top{
|
||||
width: 750rpx;
|
||||
padding: 60rpx;
|
||||
margin-bottom: 30rpx;
|
||||
padding: 10rpx 0 30rpx;
|
||||
}
|
||||
.title{
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
position: relative;
|
||||
}
|
||||
.title image{
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 25rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.typeAll {
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
background-color: #ffffff;
|
||||
line-height: 100rpx;
|
||||
position: relative;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.top-c{
|
||||
width: 690rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.l-1{
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
width: 600rpx;
|
||||
}
|
||||
.l-2{
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
width: 600rpx;
|
||||
line-height: 55rpx;
|
||||
position: relative;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
.l-2 image{
|
||||
width: 23rpx;
|
||||
height: 34rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
.top-c__r image{
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
.type {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.typeAll .type_xz {
|
||||
color: #ee7b1e;
|
||||
}
|
||||
|
||||
.typeXz {
|
||||
width:90rpx;
|
||||
height: 6rpx;
|
||||
background-color: #ee7b1e;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
|
||||
.orderAll {
|
||||
width: 750rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.order {
|
||||
width: 690rpx;
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
margin-top: 20rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.state {
|
||||
font-size: 28rpx;
|
||||
color: #ee7b1e;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 20rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.number text {
|
||||
color: #666666;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.goods {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.goodsL {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
|
||||
.goodsL image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #fcfaf7;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.goodsM {
|
||||
width: 400rpx;
|
||||
|
||||
}
|
||||
|
||||
.goodsTitle {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 50rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
.spec{
|
||||
width:100%;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.goodsPrice {
|
||||
line-height: 60rpx;
|
||||
font-size: 36rpx;
|
||||
color: #ee7b1e;
|
||||
}
|
||||
|
||||
.goodsPrice text {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.goodsR {
|
||||
font-size: 24rpx;
|
||||
color: #212320;
|
||||
}
|
||||
|
||||
.goodsR text {
|
||||
font-size: 32rpx;
|
||||
color: #0b0b0b;
|
||||
}
|
||||
|
||||
.total {
|
||||
border-top: 1rpx solid #eee;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
|
||||
.total1 {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.total2 {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.total2 text text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.total2 text {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.total3 {
|
||||
margin-left: 100rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.total3>text {
|
||||
margin-left: 30rpx;
|
||||
font-size: 36rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #ee7b1e;
|
||||
}
|
||||
|
||||
.total3>text text {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
border-radius: 24rpx;
|
||||
border: solid 1rpx #a0a0a0;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.btn .btn2 {
|
||||
border: solid 1rpx #ee7b1e;
|
||||
color: #ee7b1e;
|
||||
}
|
||||
|
||||
|
||||
.emptyImg {
|
||||
width: 337rpx;
|
||||
height: 164rpx;
|
||||
margin: 200rpx auto 50rpx;
|
||||
}
|
||||
|
||||
.emptyImg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.emptyTitle {
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 3rpx;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
margin: 50rpx 0;
|
||||
}
|
||||
Reference in New Issue
Block a user