|
@@ -6,7 +6,7 @@
|
|
|
<view class="state-info">待支付 </view>
|
|
|
<view class="order-code">剩余 09:59 逾期未支付将自动取消</view>
|
|
|
</view>
|
|
|
- <uni-icons type="right" size="24" color="#FFF"></uni-icons>
|
|
|
+ <!-- <uni-icons type="right" size="24" color="#FFF"></uni-icons> -->
|
|
|
</view>
|
|
|
<view class="gap"></view>
|
|
|
<view class="padding-sm dflex-b bg-main" @click="show = true">
|
|
@@ -15,7 +15,8 @@
|
|
|
取餐时间
|
|
|
</view>
|
|
|
</view>
|
|
|
- <u-icon slot="icon" size="20" name="arrow-right" label="04:00" labelPos="left"></u-icon>
|
|
|
+ <u-icon slot="icon" size="20" name="arrow-right" label="15:00" labelPos="left"></u-icon>
|
|
|
+ <!-- <u-icon slot="icon" size="20" name="arrow-right" :label="goods.orderPickup.writeOffTime" labelPos="left"></u-icon> -->
|
|
|
</view>
|
|
|
<view class="gap"></view>
|
|
|
<view class="padding-sm dflex-b bg-main">
|
|
@@ -25,7 +26,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <radio style="transform: scale(0.85)" value="r1" :checked="true" color="#ff0000" class="radio">店内用餐
|
|
|
+ <!-- 字段返回数据有问题 -->
|
|
|
+ <radio style="transform: scale(0.85)" value="r1" :checked="true" color="#ff0000" class="radio">
|
|
|
+ {{goods.pickupType.pickupType == '0' ? '打包带走' : '店内用餐'}}
|
|
|
</radio>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -34,29 +37,39 @@
|
|
|
<view class="goods-order-list padding-lr-sm">
|
|
|
<view class="shop dflex-b ">
|
|
|
<view class="shop-check">
|
|
|
- <text class="send-label">店铺名称</text>
|
|
|
+ <text class="send-label">{{goods.storeName}}</text>
|
|
|
</view>
|
|
|
- <view class="total-goods">共计2件商品</view>
|
|
|
+ <view class="total-goods">共计{{lists}}件商品</view>
|
|
|
</view>
|
|
|
- <view class="goods-cart">
|
|
|
+ <view class="goods-cart w-full">
|
|
|
+ <view class="goods-cont padding-tb" v-for="(item, index) in goods.orderItemVoList" :key="index">
|
|
|
+ <my-goods :item="item">
|
|
|
+ <view class="good-num">×{{item.quantity}}</view>
|
|
|
+ </my-goods>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="goods-cart" v-for="(item, index) in goods.itemList" :key="index">
|
|
|
<view class="goods-cont dflex-b padding-tb-16">
|
|
|
<view class="goods-cart-info dflex-b">
|
|
|
- <view class="pic"></view>
|
|
|
- <view class="goods-cart-right">
|
|
|
- <view class="cart-title">商品名称商品名称</view>
|
|
|
+ <view class="pic"></view>
|
|
|
+ <my-goods :item="item">
|
|
|
+ <view class="good-num">×{{item.quantity}}</view>
|
|
|
+ </my-goods>
|
|
|
+ <view class="goods-cart-right">
|
|
|
+ <view class="cart-title">{{item.skuName}}</view>
|
|
|
<view class="order-spec">
|
|
|
<text>500g</text>
|
|
|
</view>
|
|
|
<view class="cart-row-info dflex-s">
|
|
|
<view class="cart-price">
|
|
|
- ¥<text>12.30</text>
|
|
|
+ ¥<text>{{item.price}}</text>
|
|
|
</view>
|
|
|
- <view class="goods-num">×1</view>
|
|
|
+ <view class="goods-num">×{{item.quantity}}</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="goods-cont dflex-b padding-tb-16">
|
|
|
+ <view class="goods-cont dflex-b padding-tb-16">
|
|
|
<view class="goods-cart-info dflex-b">
|
|
|
<view class="pic"></view>
|
|
|
<view class="goods-cart-right">
|
|
@@ -72,23 +85,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
<view class="gap"></view>
|
|
|
<!-- 金额明细 -->
|
|
|
<view class="bg-main">
|
|
|
<view class="dflex-b padding-lr padding-tb-sm">
|
|
|
<view class="flex1 send-label">总金额</view>
|
|
|
- <view class=""><text style="font-size: 24rpx;">¥</text>46.32</view>
|
|
|
+ <view class="price">{{goods.totalAmount}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="gap"></view>
|
|
|
<view class="bar-space"></view>
|
|
|
<view class="cart-bottom padding-sm dflex-b">
|
|
|
- <view class="go-cart dflex-c">取消订单</view>
|
|
|
- <view class="go-buy dflex-c background-gradient">去支付</view>
|
|
|
+ <view class="go-cart dflex-c" @click="toDelete()">取消订单</view>
|
|
|
+ <view class="go-buy dflex-c background-gradient" @click="toPay()">去支付</view>
|
|
|
</view>
|
|
|
+ <u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -96,11 +110,158 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ goods: {},
|
|
|
+ lists: 0
|
|
|
}
|
|
|
},
|
|
|
+ onLoad(e) {
|
|
|
+ var dataString = decodeURIComponent(e.data)
|
|
|
+ var data = JSON.parse(dataString);
|
|
|
+ console.log('data', data)
|
|
|
+ this.goods = data
|
|
|
+ this.lists = this.goods.orderItemVoList.length
|
|
|
+ this.goods.orderItemVoList.forEach(item => {
|
|
|
+ item.imgUrl = item.picUrl
|
|
|
+ })
|
|
|
+ console.log('this.lists', this.lists)
|
|
|
+ // this.fatchDate(e)
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async fatchDate(e) {
|
|
|
+ console.log('e', e)
|
|
|
+ const result = await this.$request('get', `/order/tradeOrder/queryTradeOrder/${e.id}`,
|
|
|
+ true)
|
|
|
+ if (result) {
|
|
|
+ console.log('result', result.data)
|
|
|
+ this.goods = result.data
|
|
|
+ this.lists = this.goods.itemList.length
|
|
|
+ this.goods.itemList.forEach(item => {
|
|
|
+ item.imgUrl = item.picUrl
|
|
|
+ })
|
|
|
+ console.log('this.goods', this.goods)
|
|
|
+ console.log('this.goods.itemList', this.goods.itemList)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ uuid() {
|
|
|
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
|
|
+ var r = Math.random() * 16 | 0,
|
|
|
+ v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
|
+ return v.toString(16);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toDelete() {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'default',
|
|
|
+ title: '默认主题',
|
|
|
+ message: "演示阶段暂时不能取消",
|
|
|
+ position: 'center'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toPay() {
|
|
|
+ // 显示提示
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'default',
|
|
|
+ title: '默认主题',
|
|
|
+ message: "演示阶段暂时不能支付",
|
|
|
+ position: 'center'
|
|
|
+ })
|
|
|
+
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '演示阶段暂时不能支付',
|
|
|
+ // icon: 'error',
|
|
|
+ // duration: 1000
|
|
|
+ // });
|
|
|
+ // const params = {
|
|
|
+ // orderId: this.goods.orderId,
|
|
|
+ // amount: this.goods.payment,
|
|
|
+ // }
|
|
|
+ // this.$request('post', `/order/orderPay/addOrderPay`, params, true).then(res => {
|
|
|
+ // this._toPay()
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ async _toPay() {
|
|
|
+ console.log('this.uuid()', this.uuid())
|
|
|
+ const openId = uni.getStorageSync('openId');
|
|
|
+ const token = uni.getStorageSync('token');
|
|
|
+ if (!token) {
|
|
|
+ await this.autoLogin()
|
|
|
+ }
|
|
|
+ const that = this;
|
|
|
+ uni.request({
|
|
|
+ url: 'http://36.137.224.81:8030/weChatPay/payment/miniPay',
|
|
|
+ header: {
|
|
|
+ // "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", //
|
|
|
+ "Content-Type": "application/json;charset=UTF-8", //
|
|
|
+ 'Authorization': 'Bearer ' + token,
|
|
|
+ },
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ tenantId: '000000',
|
|
|
+ outTradeNo: this.uuid(),
|
|
|
+ openId: openId,
|
|
|
+ total: Math.round(this.goods.payment * 10), //以分为单位
|
|
|
+ profitSharing: false // 是否分销
|
|
|
+ },
|
|
|
|
|
|
+ success: res => {
|
|
|
+ console.log('预支付成功')
|
|
|
+ that.data = res.data;
|
|
|
+ wx.requestPayment({
|
|
|
+ "timeStamp": res.data.timeStamp,
|
|
|
+ "nonceStr": res.data.nonceStr,
|
|
|
+ "package": res.data.packageValue,
|
|
|
+ "signType": "RSA",
|
|
|
+ "paySign": res.data.paySign,
|
|
|
+ "success": function(res) {
|
|
|
+ console.log('调用支付接口成功', res)
|
|
|
+ },
|
|
|
+ "fail": function(res) {
|
|
|
+ console.log('调用支付接口fail', res)
|
|
|
+ },
|
|
|
+ "complete": function(res) {
|
|
|
+ console.log('调用支付接口完成', res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: err => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // const params = {
|
|
|
+ // tenantId: '000000',
|
|
|
+ // outTradeNo: this.uuid(),
|
|
|
+ // openId: openId,
|
|
|
+ // total: Math.round(this.goods.payment * 10), //以分为单位
|
|
|
+ // profitSharing: false // 是否分销
|
|
|
+ // }
|
|
|
+ // console.log('params', params)
|
|
|
+ // this.$request('post', `/weChatPay/payment/miniPay`, params, true).then(res => {
|
|
|
+ // // 请求成功
|
|
|
+ // console.log('response', res)
|
|
|
+ // console.log('预支付成功')
|
|
|
+ // that.data = res.data;
|
|
|
+ // wx.requestPayment({
|
|
|
+ // "timeStamp": res.data.timeStamp,
|
|
|
+ // "nonceStr": res.data.nonceStr,
|
|
|
+ // "package": res.data.packageValue,
|
|
|
+ // "signType": "RSA",
|
|
|
+ // "paySign": res.data.paySign,
|
|
|
+ // "success": function(res) {
|
|
|
+ // console.log('调用支付接口成功', res)
|
|
|
+ // },
|
|
|
+ // "fail": function(res) {
|
|
|
+ // console.log('调用支付接口fail', res)
|
|
|
+ // },
|
|
|
+ // "complete": function(res) {
|
|
|
+ // console.log('调用支付接口完成', res)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }).catch(error => {
|
|
|
+ // // 请求失败
|
|
|
+ // uni.hideLoading()
|
|
|
+ // console.error('请求失败:', error);
|
|
|
+ // })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -112,7 +273,7 @@
|
|
|
color: #FFF;
|
|
|
|
|
|
.state-info {
|
|
|
- font-size: 14px;
|
|
|
+ font-size: 18px;
|
|
|
padding-bottom: 4px;
|
|
|
}
|
|
|
|
|
@@ -269,4 +430,14 @@
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .good-num {
|
|
|
+ font-size: 12px;
|
|
|
+ padding-top: 65rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .goods-cont {
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
</style>
|