Commit 7c039b6f9a93bf342cb7baaf37f6dbd6609f8f21
1 parent
9394b5df70
Exists in
master
订单详情页规格修改
Showing
3 changed files
with
107 additions
and
42 deletions
Show diff stats
src/pages/myOrderPaying/myOrderPaying.vue
| 1 | <!-- 订单待付款 待收货 --> | 1 | <!-- 订单待付款 待收货 --> |
| 2 | <template> | 2 | <template> |
| 3 | <view class="content"> | 3 | <view class="content"> |
| 4 | <view | 4 | <view |
| 5 | class="headerBanner" | 5 | class="headerBanner" |
| 6 | v-if="status == '2'||'3'" | 6 | v-if="status == '2'||'3'" |
| 7 | > | 7 | > |
| 8 | <view class="bannerLeft"> | 8 | <view class="bannerLeft"> |
| 9 | <view class="T1">订单已完成</view> | 9 | <view class="T1">订单已完成</view> |
| 10 | </view> | 10 | </view> |
| 11 | <image | 11 | <image |
| 12 | src="../../static/car.png" | 12 | src="../../static/car.png" |
| 13 | mode="aspectFill" | 13 | mode="aspectFill" |
| 14 | ></image> | 14 | ></image> |
| 15 | </view> | 15 | </view> |
| 16 | <!-- 待付款 --> | 16 | <!-- 待付款 --> |
| 17 | <view | 17 | <view |
| 18 | class="order-time" | 18 | class="order-time" |
| 19 | v-if="status == '0'" | 19 | v-if="status == '0'" |
| 20 | > | 20 | > |
| 21 | <text>请在</text> | 21 | <text>请在</text> |
| 22 | <uni-countdown | 22 | <uni-countdown |
| 23 | color="#EC5D3B" | 23 | color="#EC5D3B" |
| 24 | splitor-color="#EC5D3B" | 24 | splitor-color="#EC5D3B" |
| 25 | :show-day="false" | 25 | :show-day="false" |
| 26 | :hour="0" | 26 | :hour="0" |
| 27 | :second="getLeftTime" | 27 | :second="getLeftTime" |
| 28 | @timeup="timeup" | 28 | @timeup="timeup" |
| 29 | > | 29 | > |
| 30 | </uni-countdown> | 30 | </uni-countdown> |
| 31 | 31 | ||
| 32 | <text>内完成付款</text> | 32 | <text>内完成付款</text> |
| 33 | </view> | 33 | </view> |
| 34 | 34 | ||
| 35 | <view | 35 | <view |
| 36 | class="headerBanner" | 36 | class="headerBanner" |
| 37 | v-if="status == '1'" | 37 | v-if="status == '1'" |
| 38 | > | 38 | > |
| 39 | <view class="bannerLeft"> | 39 | <view class="bannerLeft"> |
| 40 | <view class="T1">卖家已发货</view> | 40 | <view class="T1">卖家已发货</view> |
| 41 | <!-- <view class="T2">还剩 确认收货</view> --> | 41 | <!-- <view class="T2">还剩 确认收货</view> --> |
| 42 | </view> | 42 | </view> |
| 43 | <image | 43 | <image |
| 44 | src="../../static/car.png" | 44 | src="../../static/car.png" |
| 45 | mode="aspectFill" | 45 | mode="aspectFill" |
| 46 | ></image> | 46 | ></image> |
| 47 | </view> | 47 | </view> |
| 48 | 48 | ||
| 49 | <view class="order"> | 49 | <view class="order"> |
| 50 | <view class="order-user"> | 50 | <view class="order-user"> |
| 51 | <view class="order-user-head"> | 51 | <view class="order-user-head"> |
| 52 | <text class="p1">{{orderAddressInfo.name}}</text> | 52 | <text class="p1">{{orderAddressInfo.name}}</text> |
| 53 | <text class="p2">{{orderAddressInfo.mobile}}</text> | 53 | <text class="p2">{{orderAddressInfo.mobile}}</text> |
| 54 | </view> | 54 | </view> |
| 55 | <view class="order-user-body"> | 55 | <view class="order-user-body"> |
| 56 | <image src="../../static/myorder-paying-location.png"></image> | 56 | <image src="../../static/myorder-paying-location.png"></image> |
| 57 | <text class="p3">{{orderAddressInfo.address}}</text> | 57 | <text class="p3">{{orderAddressInfo.address}}</text> |
| 58 | </view> | 58 | </view> |
| 59 | </view> | 59 | </view> |
| 60 | <view class="order-info"> | 60 | <view class="order-info"> |
| 61 | <view | 61 | <view |
| 62 | class="order-info-head" | 62 | class="order-info-head" |
| 63 | v-for="(orderInfoListItem,index) in orderInfoList" | 63 | v-for="(orderInfoListItem, index) in orderInfoList" |
| 64 | :key="index" | 64 | :key="index" |
| 65 | > | 65 | > |
| 66 | <image | 66 | <image |
| 67 | :src="orderInfoListItem.imgUrl" | 67 | :src="orderInfoListItem.imgUrl" |
| 68 | mode="aspectFill" | 68 | mode="aspectFill" |
| 69 | ></image> | 69 | ></image> |
| 70 | <view class="order-info-head-r"> | 70 | <view class="order-info-head-r"> |
| 71 | <text class="p1">{{orderInfoListItem.p_name}}</text> | 71 | <text class="p1">{{orderInfoListItem.p_name}}</text> |
| 72 | <view | 72 | <view |
| 73 | class="p2" | 73 | class="p2" |
| 74 | style="margin: 0;" | 74 | style="margin: 0;" |
| 75 | > | 75 | > |
| 76 | 规格:玫瑰金 / 钛合金 / 防日光防紫外线 / 超薄超轻 | 76 | <!-- {{index}} --> |
| 77 | {{skuList[index] ? skuList[0].sku_name.replace('_', '/') : ''}} | ||
| 78 | <!-- {{skuList.length === 0 ? '' : skuList[0].sku_name.replace('_', '/')}} --> | ||
| 77 | <!-- <view class="arrow"></view> --> | 79 | <!-- <view class="arrow"></view> --> |
| 78 | </view> | 80 | </view> |
| 79 | <view class="infoText-bottom"> | 81 | <view class="infoText-bottom"> |
| 80 | <view class="markPrice">{{Number(orderInfoListItem.nowPrice)/100}}</view> | 82 | <view class="markPrice">¥{{Number(orderInfoListItem.nowPrice)/100}}</view> |
| 81 | <view class="buy-num">X {{orderInfoListItem.num}}</view> | 83 | <view class="buy-num">X {{orderInfoListItem.num}}</view> |
| 82 | </view> | 84 | </view> |
| 83 | </view> | 85 | </view> |
| 84 | </view> | 86 | </view> |
| 85 | <!-- <view class="order-info-goodsnum"> | 87 | <!-- <view class="order-info-goodsnum"> |
| 86 | <text>X1</text> | 88 | <text>X1</text> |
| 87 | </view> --> | 89 | </view> --> |
| 88 | <text class="order-info-freight"> | 90 | <text class="order-info-freight"> |
| 89 | <text class="p1">运费</text> | 91 | <text class="p1">运费</text> |
| 90 | <text class="p2">免运费</text> | 92 | <text class="p2">免运费</text> |
| 91 | </text> | 93 | </text> |
| 92 | <text class="order-info-discount"> | 94 | <text class="order-info-discount"> |
| 93 | <text class="p1">优惠</text> | 95 | <text class="p1">优惠</text> |
| 94 | <text class="p2">-¥{{totalDiscount}}</text> | 96 | <text class="p2">-¥{{totalDiscount}}</text> |
| 95 | </text> | 97 | </text> |
| 96 | <text class="order-info-price"> | 98 | <text class="order-info-price"> |
| 97 | <text class="p1">实付</text> | 99 | <text class="p1">实付</text> |
| 98 | <text class="p2">¥{{Number(totalPrice)/100}}</text> | 100 | <text class="p2">¥{{Number(totalPrice)/100}}</text> |
| 99 | </text> | 101 | </text> |
| 100 | <text class="order-info-num"> | 102 | <text class="order-info-num"> |
| 101 | <text>订单号:{{payId}}</text> | 103 | <text>订单号:{{payId}}</text> |
| 102 | </text> | 104 | </text> |
| 103 | <text class="order-info-time"> | 105 | <text class="order-info-time"> |
| 104 | <text>下单时间:{{orderInfo.pay_time}}</text> | 106 | <text>下单时间:{{orderInfo.pay_time}}</text> |
| 105 | </text> | 107 | </text> |
| 106 | <view class="order-info-hr"></view> | 108 | <view class="order-info-hr"></view> |
| 107 | <view class="order-info-contact"> | 109 | <view class="order-info-contact"> |
| 108 | <image src="../../static/myorder-paying-contact.png"></image> | 110 | <image src="../../static/myorder-paying-contact.png"></image> |
| 109 | <button open-type="contact">联系客服</button> | 111 | <button open-type="contact">联系客服</button> |
| 110 | </view> | 112 | </view> |
| 111 | </view> | 113 | </view> |
| 112 | </view> | 114 | </view> |
| 113 | <view | 115 | <view |
| 114 | class="order-confim" | 116 | class="order-confim" |
| 115 | v-if="status == '0'" | 117 | v-if="status == '0'" |
| 116 | > | 118 | > |
| 117 | <button | 119 | <button |
| 118 | class="b1" | 120 | class="b1" |
| 119 | @click="cancleOrder" | 121 | @click="cancleOrder" |
| 120 | >取消订单</button> | 122 | >取消订单</button> |
| 121 | <button | 123 | <button |
| 122 | class="b2" | 124 | class="b2" |
| 123 | @click="paylog" | 125 | @click="paylog" |
| 124 | >立即支付</button> | 126 | >立即支付</button> |
| 125 | </view> | 127 | </view> |
| 126 | 128 | ||
| 127 | <view | 129 | <view |
| 128 | class="order-confim" | 130 | class="order-confim" |
| 129 | v-if="status == '1'" | 131 | v-if="status == '1'" |
| 130 | > | 132 | > |
| 131 | <!-- <button class="b1">取消订单</button> --> | 133 | <!-- <button class="b1">取消订单</button> --> |
| 132 | <button | 134 | <button |
| 133 | class="b2" | 135 | class="b2" |
| 134 | @click="confirmOrder" | 136 | @click="confirmOrder" |
| 135 | >确认收货</button> | 137 | >确认收货</button> |
| 136 | </view> | 138 | </view> |
| 137 | <view | 139 | <view |
| 138 | class="order-confim" | 140 | class="order-confim" |
| 139 | v-if="status == '2'" | 141 | v-if="status == '2'" |
| 140 | > | 142 | > |
| 141 | <button | 143 | <button |
| 142 | class="b2" | 144 | class="b2" |
| 143 | @click="toDetail" | 145 | @click="toDetail" |
| 144 | >再次购买</button> | 146 | >再次购买</button> |
| 145 | </view> | 147 | </view> |
| 146 | 148 | ||
| 147 | </view> | 149 | </view> |
| 148 | </template> | 150 | </template> |
| 149 | 151 | ||
| 150 | <script> | 152 | <script> |
| 151 | import store from '@/store' | 153 | import store from '@/store' |
| 152 | import MD5Util from '../../utils/md5' | 154 | import MD5Util from '../../utils/md5' |
| 153 | import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' | 155 | import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' |
| 154 | export default { | 156 | export default { |
| 155 | components: { | 157 | components: { |
| 156 | UniCountdown, | 158 | UniCountdown, |
| 157 | }, | 159 | }, |
| 158 | data() { | 160 | data() { |
| 159 | return { | 161 | return { |
| 160 | payId: '', | 162 | payId: '', |
| 161 | payTime: '', | 163 | payTime: '', |
| 162 | status: '', // status 0 待付款 1 已发货 | 164 | status: '', // status 0 待付款 1 已发货 |
| 163 | uid: '', | 165 | uid: '', |
| 164 | openid: '', | 166 | openid: '', |
| 165 | lefttime: 0, | 167 | lefttime: 0, |
| 166 | isPay: 0, | 168 | isPay: 0, |
| 167 | totalPrice: 0, | 169 | totalPrice: 0, |
| 168 | } | 170 | } |
| 169 | }, | 171 | }, |
| 170 | async onLoad ({ payId, status, isPay }) { | 172 | async onLoad ({ payId, status, isPay }) { |
| 171 | this.payId = payId | 173 | this.payId = payId |
| 172 | this.status = status | 174 | this.status = status |
| 173 | this.isPay = isPay | 175 | this.isPay = isPay |
| 174 | // console.log('++++++++++++++++++',this.status) | 176 | // console.log('++++++++++++++++++',this.status) |
| 175 | const openid = uni.getStorageSync('openid') | 177 | const openid = uni.getStorageSync('openid') |
| 176 | const uid = this.$store.state.user.userInfo.uid | 178 | const uid = this.$store.state.user.userInfo.uid |
| 177 | this.uid = uid | 179 | this.uid = uid |
| 178 | this.openid = openid | 180 | this.openid = openid |
| 179 | await store.dispatch('orderRead/getOrderInfo', { | 181 | await store.dispatch('orderRead/getOrderInfo', { |
| 180 | pay_id: this.payId, | 182 | pay_id: this.payId, |
| 181 | uid: uid, | 183 | uid: uid, |
| 182 | openid: openid, | 184 | openid: openid, |
| 183 | }) | 185 | }) |
| 186 | const { list } = this.orderInfo.order_info | ||
| 187 | for (let index = 0; index < list.length; index++) { | ||
| 188 | await store.dispatch('orderRead/goodDetails', { | ||
| 189 | pid: list[index].pid, | ||
| 190 | skId: list[index].sk_id, | ||
| 191 | }) | ||
| 192 | } | ||
| 184 | this.totalPrice = this.orderInfo.total_fee | 193 | this.totalPrice = this.orderInfo.total_fee |
| 185 | }, | 194 | }, |
| 186 | // 若从支付页面跳转过来,返回直接返回到首页 | 195 | // 若从支付页面跳转过来,返回直接返回到首页 |
| 187 | onBackPress(option) { | 196 | onBackPress(option) { |
| 188 | if (option.from === 'backbutton' && this.isPay) { | 197 | if (option.from === 'backbutton' && this.isPay) { |
| 189 | uni.switchTab({ | 198 | uni.switchTab({ |
| 190 | url: '/pages/index/index', | 199 | url: '/pages/index/index', |
| 191 | }) | 200 | }) |
| 192 | return true // 阻止默认返回行为 | 201 | return true // 阻止默认返回行为 |
| 193 | } | 202 | } |
| 194 | }, | 203 | }, |
| 195 | computed: { | 204 | computed: { |
| 205 | // 规格列表 | ||
| 206 | skuList () { | ||
| 207 | return this.$store.state.orderRead.skuList | ||
| 208 | }, | ||
| 196 | orderInfo() { | 209 | orderInfo() { |
| 197 | return this.$store.state.orderRead.orderInfo | 210 | return this.$store.state.orderRead.orderInfo |
| 198 | }, | 211 | }, |
| 199 | orderInfoList () { | 212 | orderInfoList () { |
| 200 | return this.orderInfo.order_info ? this.orderInfo.order_info.list : null | 213 | return this.orderInfo.order_info ? this.orderInfo.order_info.list : null |
| 201 | }, | 214 | }, |
| 202 | // 获取订单地址信息 | 215 | // 获取订单地址信息 |
| 203 | orderAddressInfo () { | 216 | orderAddressInfo () { |
| 204 | return this.orderInfo.order_info ? this.orderInfo.order_info.address : null | 217 | return this.orderInfo.order_info ? this.orderInfo.order_info.address : null |
| 205 | }, | 218 | }, |
| 206 | // 订单付款时间 | 219 | // 订单付款时间 |
| 207 | getLeftTime () { | 220 | getLeftTime () { |
| 208 | return this.orderInfo.order_info ? this.orderInfo.order_info.lefttime : 1800 | 221 | return this.orderInfo.order_info ? this.orderInfo.order_info.lefttime : 1800 |
| 209 | }, | 222 | }, |
| 210 | // 计算总优惠额 | 223 | // 计算总优惠额 |
| 211 | totalDiscount() { | 224 | totalDiscount() { |
| 212 | const discountInfoList = this.orderInfo.discount_info | 225 | const discountInfoList = this.orderInfo.discount_info |
| 213 | let totalDiscount = 0 | 226 | let totalDiscount = 0 |
| 214 | if (discountInfoList) { | 227 | if (discountInfoList) { |
| 215 | discountInfoList.map((discountItem, index) => { | 228 | discountInfoList.map((discountItem, index) => { |
| 216 | totalDiscount += Number(discountItem.value) | 229 | totalDiscount += Number(discountItem.value) |
| 217 | }) | 230 | }) |
| 218 | } | 231 | } |
| 219 | // console.log(totalDiscount) | 232 | // console.log(totalDiscount) |
| 220 | return totalDiscount | 233 | return totalDiscount |
| 221 | }, | 234 | }, |
| 222 | }, | 235 | }, |
| 223 | 236 | ||
| 224 | methods: { | 237 | methods: { |
| 225 | // 再次购买 暂时只支持跳转第一个商品 | 238 | // 再次购买 暂时只支持跳转第一个商品 |
| 226 | toDetail() { | 239 | toDetail() { |
| 227 | const pid = this.orderInfo.order_info.list[0].pid | 240 | const pid = this.orderInfo.order_info.list[0].pid |
| 228 | uni.navigateTo({ | 241 | uni.navigateTo({ |
| 229 | url: '../details/details?pid=' + pid, | 242 | url: '../details/details?pid=' + pid, |
| 230 | fail: (res) => { console.log(res) }, | 243 | fail: (res) => { console.log(res) }, |
| 231 | }) | 244 | }) |
| 232 | }, | 245 | }, |
| 233 | // 取消订单 | 246 | // 取消订单 |
| 234 | timeup() { | 247 | timeup() { |
| 235 | this.cancleOrder() | 248 | this.cancleOrder() |
| 236 | }, | 249 | }, |
| 237 | cancleOrder() { | 250 | cancleOrder() { |
| 238 | const uid = this.uid | 251 | console.log('dddd', this.skuList) |
| 239 | const openid = this.openid | 252 | // const uid = this.uid |
| 240 | const keyname = this.orderInfo.order_info.keyname | 253 | // const openid = this.openid |
| 241 | // console.log('keyname',this.orderInfo.keyname) | 254 | // const keyname = this.orderInfo.order_info.keyname |
| 242 | uni.showModal({ | 255 | // // console.log('keyname',this.orderInfo.keyname) |
| 243 | title: '提示', | 256 | // uni.showModal({ |
| 244 | content: '现在取消,订单不可恢复哦,确认取消吗?', | 257 | // title: '提示', |
| 245 | success: function(res) { | 258 | // content: '现在取消,订单不可恢复哦,确认取消吗?', |
| 246 | if (res.confirm) { | 259 | // success: function(res) { |
| 247 | store.dispatch('cancelOrder/cancel', { | 260 | // if (res.confirm) { |
| 248 | keyname: keyname, | 261 | // store.dispatch('cancelOrder/cancel', { |
| 249 | uid: uid, | 262 | // keyname: keyname, |
| 250 | openid: openid, | 263 | // uid: uid, |
| 251 | }) | 264 | // openid: openid, |
| 252 | uni.navigateBack({ | 265 | // }) |
| 253 | delta: 1, | 266 | // uni.navigateBack({ |
| 254 | }) | 267 | // delta: 1, |
| 255 | } else if (res.cancel) { | 268 | // }) |
| 256 | console.log('用户点击取消') | 269 | // } else if (res.cancel) { |
| 257 | } | 270 | // console.log('用户点击取消') |
| 258 | }, | 271 | // } |
| 259 | }) | 272 | // }, |
| 273 | // }) | ||
| 260 | }, | 274 | }, |
| 261 | paylog() { | 275 | paylog() { |
| 262 | console.log('pay', this.orderInfo) | 276 | console.log('pay', this.orderInfo) |
| 263 | const { data, exKeyName: keyName } = this.orderInfo | 277 | const { data, exKeyName: keyName } = this.orderInfo |
| 264 | const uid = uni.getStorageSync('uid') | 278 | const uid = uni.getStorageSync('uid') |
| 265 | const timeStamp = new Date().getTime().toString() | 279 | const timeStamp = new Date().getTime().toString() |
| 266 | const nonceStr = 'asfafasfasfasfasf' | 280 | const nonceStr = 'asfafasfasfasfasf' |
| 267 | // 支付参数 | 281 | // 支付参数 |
| 268 | const fieldSet = { | 282 | const fieldSet = { |
| 269 | openid: this.$store.state.user.userInfo.openid, | 283 | openid: this.$store.state.user.userInfo.openid, |
| 270 | uid: this.$store.state.user.userInfo.uid, | 284 | uid: this.$store.state.user.userInfo.uid, |
| 271 | shopid: 0, | 285 | shopid: 0, |
| 272 | payCate: 2020, | 286 | payCate: 2020, |
| 273 | payMoney: this.totalPrice, | 287 | payMoney: this.totalPrice, |
| 274 | payWoodId: `fcdj-${uid}-${keyName}`, | 288 | payWoodId: `fcdj-${uid}-${keyName}`, |
| 275 | payWoodDesc: '在【非常戴镜】的微信付款凭证', | 289 | payWoodDesc: '在【非常戴镜】的微信付款凭证', |
| 276 | nonceStr, | 290 | nonceStr, |
| 277 | signType: 'MD5', | 291 | signType: 'MD5', |
| 278 | app_uid: 2020, | 292 | app_uid: 2020, |
| 279 | timeStamp, | 293 | timeStamp, |
| 280 | keyname: keyName, | 294 | keyname: keyName, |
| 281 | billInfo: JSON.stringify(data), | 295 | billInfo: JSON.stringify(data), |
| 282 | } | 296 | } |
| 283 | // 请求后台支付接口 | 297 | // 请求后台支付接口 |
| 284 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { | 298 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { |
| 285 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | 299 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { |
| 286 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | 300 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` |
| 287 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | 301 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' |
| 288 | 302 | ||
| 289 | // 微信支付接口 | 303 | // 微信支付接口 |
| 290 | uni.requestPayment({ | 304 | uni.requestPayment({ |
| 291 | appId: data.appid, | 305 | appId: data.appid, |
| 292 | timeStamp, | 306 | timeStamp, |
| 293 | nonceStr, | 307 | nonceStr, |
| 294 | total_fee: this.totalPrice, | 308 | total_fee: this.totalPrice, |
| 295 | package: `prepay_id=${data.prepay_id}`, | 309 | package: `prepay_id=${data.prepay_id}`, |
| 296 | signType: 'MD5', | 310 | signType: 'MD5', |
| 297 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | 311 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), |
| 298 | success: (res) => { | 312 | success: (res) => { |
| 299 | // 支付成功 | 313 | // 支付成功 |
| 300 | uni.showModal({ | 314 | uni.showModal({ |
| 301 | content: '支付成功', | 315 | content: '支付成功', |
| 302 | showCancel: false, | 316 | showCancel: false, |
| 303 | }) | 317 | }) |
| 304 | // 跳转订单详情页->状态 待收货 | 318 | // 跳转订单详情页->状态 待收货 |
| 305 | uni.reLaunch({ | 319 | uni.reLaunch({ |
| 306 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, | 320 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, |
| 307 | }) | 321 | }) |
| 308 | }, | 322 | }, |
| 309 | fail: (res) => { | 323 | fail: (res) => { |
| 310 | // 支付失败 | 324 | // 支付失败 |
| 311 | uni.showModal({ | 325 | uni.showModal({ |
| 312 | content: '支付失败', | 326 | content: '支付失败', |
| 313 | showCancel: false, | 327 | showCancel: false, |
| 314 | }) | 328 | }) |
| 315 | // 跳转订单详情页->刷新本页面 | 329 | // 跳转订单详情页->刷新本页面 |
| 316 | // uni.redirectTo({ | 330 | // uni.redirectTo({ |
| 317 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | 331 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, |
| 318 | // }) | 332 | // }) |
| 319 | }, | 333 | }, |
| 320 | complete: () => { | 334 | complete: () => { |
| 321 | uni.hideLoading() | 335 | uni.hideLoading() |
| 322 | }, | 336 | }, |
| 323 | }) | 337 | }) |
| 324 | } else { | 338 | } else { |
| 325 | uni.showModal({ | 339 | uni.showModal({ |
| 326 | content: '支付失败', | 340 | content: '支付失败', |
| 327 | showCancel: false, | 341 | showCancel: false, |
| 328 | }) | 342 | }) |
| 329 | console.log('支付失败') | 343 | console.log('支付失败') |
| 330 | uni.hideLoading() | 344 | uni.hideLoading() |
| 331 | // uni.redirectTo({ | 345 | // uni.redirectTo({ |
| 332 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | 346 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, |
| 333 | // }) | 347 | // }) |
| 334 | } | 348 | } |
| 335 | }) | 349 | }) |
| 336 | 350 | ||
| 337 | // 修改订单状态 待付款==>待收货 | 351 | // 修改订单状态 待付款==>待收货 |
| 338 | store.dispatch('statusConfirm/confirm', { | 352 | store.dispatch('statusConfirm/confirm', { |
| 339 | uid: this.uid, | 353 | uid: this.uid, |
| 340 | openid: this.openid, | 354 | openid: this.openid, |
| 341 | oldway: '0', | 355 | oldway: '0', |
| 342 | way: '1', | 356 | way: '1', |
| 343 | pay_id: this.payId, | 357 | pay_id: this.payId, |
| 344 | judgeContent: '', | 358 | judgeContent: '', |
| 345 | orderInfo: this.orderInfo.order_info, | 359 | orderInfo: this.orderInfo.order_info, |
| 346 | }) | 360 | }) |
| 347 | .then( | 361 | .then( |
| 348 | // setTimeout(() => { | 362 | // setTimeout(() => { |
| 349 | // uni.navigateBack(); | 363 | // uni.navigateBack(); |
| 350 | // }, 1500) | 364 | // }, 1500) |
| 351 | ) | 365 | ) |
| 352 | }, | 366 | }, |
| 353 | confirmOrder() { | 367 | confirmOrder() { |
| 354 | // 确认收货 way1 ==>way2 | 368 | // 确认收货 way1 ==>way2 |
| 355 | store | 369 | store |
| 356 | .dispatch('statusConfirm/confirm', { | 370 | .dispatch('statusConfirm/confirm', { |
| 357 | uid: this.uid, | 371 | uid: this.uid, |
| 358 | openid: this.openid, | 372 | openid: this.openid, |
| 359 | oldway: '1', | 373 | oldway: '1', |
| 360 | way: '2', | 374 | way: '2', |
| 361 | pay_id: this.payId, | 375 | pay_id: this.payId, |
| 362 | judgeContent: '', | 376 | judgeContent: '', |
| 363 | orderInfo: this.orderInfo.order_info, | 377 | orderInfo: this.orderInfo.order_info, |
| 364 | }) | 378 | }) |
| 365 | .then((res) => { | 379 | .then((res) => { |
| 366 | if (res.data.code === 1) { | 380 | if (res.data.code === 1) { |
| 367 | uni.showToast({ | 381 | uni.showToast({ |
| 368 | title: '已确认', | 382 | title: '已确认', |
| 369 | mask: true, | 383 | mask: true, |
| 370 | duration: 1500, | 384 | duration: 1500, |
| 371 | icon: 'success', | 385 | icon: 'success', |
| 372 | }) | 386 | }) |
| 373 | } else { | 387 | } else { |
| 374 | uni.showToast({ | 388 | uni.showToast({ |
| 375 | title: '服务器错误,确认失败!', | 389 | title: '服务器错误,确认失败!', |
| 376 | mask: true, | 390 | mask: true, |
| 377 | }) | 391 | }) |
| 378 | } | 392 | } |
| 379 | setTimeout(() => { | 393 | setTimeout(() => { |
| 380 | uni.navigateBack() | 394 | uni.navigateBack() |
| 381 | }, 1500) | 395 | }, 1500) |
| 382 | }) | 396 | }) |
| 383 | }, | 397 | }, |
| 384 | }, | 398 | }, |
| 385 | // filters: { | 399 | // filters: { |
| 386 | // timerChange: function(value) { | 400 | // timerChange: function(value) { |
| 387 | // var newDate = new Date() | 401 | // var newDate = new Date() |
| 388 | // newDate.setTime(value * 1000) | 402 | // newDate.setTime(value * 1000) |
| 389 | // return newDate.toLocaleString() | 403 | // return newDate.toLocaleString() |
| 390 | // }, | 404 | // }, |
| 391 | // }, | 405 | // }, |
| 392 | } | 406 | } |
| 393 | </script> | 407 | </script> |
| 394 | 408 | ||
| 395 | <style lang="scss" scoped> | 409 | <style lang="scss" scoped> |
| 396 | .content { | 410 | .content { |
| 397 | min-height: 100vh; | 411 | min-height: 100vh; |
| 398 | display: flex; | 412 | display: flex; |
| 399 | flex-direction: column; | 413 | flex-direction: column; |
| 400 | justify-content: flex-start; | 414 | justify-content: flex-start; |
| 401 | align-items: center; | 415 | align-items: center; |
| 402 | background-color: #f2f2f2; | 416 | background-color: #f2f2f2; |
| 403 | } | 417 | } |
| 404 | 418 | ||
| 405 | .order { | 419 | .order { |
| 406 | margin-bottom: 112rpx; | 420 | margin-bottom: 112rpx; |
| 407 | background: #f2f2f2; | 421 | background: #f2f2f2; |
| 408 | margin-top: 140rpx; | 422 | margin-top: 140rpx; |
| 409 | width: 670rpx; | 423 | width: 670rpx; |
| 410 | } | 424 | } |
| 411 | 425 | ||
| 412 | .order-time { | 426 | .order-time { |
| 413 | width: 100%; | 427 | width: 100%; |
| 414 | height: 140rpx; | 428 | height: 140rpx; |
| 415 | background-color: #fff; | 429 | background-color: #fff; |
| 416 | display: flex; | 430 | display: flex; |
| 417 | justify-content: center; | 431 | justify-content: center; |
| 418 | align-items: center; | 432 | align-items: center; |
| 419 | position: fixed; | 433 | position: fixed; |
| 420 | top: 0; | 434 | top: 0; |
| 421 | left: 0; | 435 | left: 0; |
| 422 | text { | 436 | text { |
| 423 | // font-family: PingFangSC-Regular; | 437 | // font-family: PingFangSC-Regular; |
| 424 | // margin-top: 48rpx; | 438 | // margin-top: 48rpx; |
| 425 | font-size: 14px; | 439 | font-size: 14px; |
| 426 | color: #333333; | 440 | color: #333333; |
| 427 | letter-spacing: -0.26px; | 441 | letter-spacing: -0.26px; |
| 428 | } | 442 | } |
| 429 | .p2 { | 443 | .p2 { |
| 430 | // font-family: DINAlternate-Bold; | 444 | // font-family: DINAlternate-Bold; |
| 431 | margin: 42rpx 20rpx 0 20rpx; | 445 | margin: 42rpx 20rpx 0 20rpx; |
| 432 | font-size: 18px; | 446 | font-size: 18px; |
| 433 | color: #ec5d3b; | 447 | color: #ec5d3b; |
| 434 | letter-spacing: -0.34px; | 448 | letter-spacing: -0.34px; |
| 435 | } | 449 | } |
| 436 | } | 450 | } |
| 437 | .headerBanner { | 451 | .headerBanner { |
| 438 | width: 100%; | 452 | width: 100%; |
| 439 | height: 140rpx; | 453 | height: 140rpx; |
| 440 | background: #4a90e2; | 454 | background: #4a90e2; |
| 441 | padding: 26rpx 60rpx 24rpx 60rpx; | 455 | padding: 26rpx 60rpx 24rpx 60rpx; |
| 442 | box-sizing: border-box; | 456 | box-sizing: border-box; |
| 443 | color: #ffffff; | 457 | color: #ffffff; |
| 444 | display: flex; | 458 | display: flex; |
| 445 | justify-content: space-between; | 459 | justify-content: space-between; |
| 446 | align-items: center; | 460 | align-items: center; |
| 447 | position: fixed; | 461 | position: fixed; |
| 448 | top: 0; | 462 | top: 0; |
| 449 | left: 0; | 463 | left: 0; |
| 450 | .bannerLeft { | 464 | .bannerLeft { |
| 451 | font-size: 36rpx; | 465 | font-size: 36rpx; |
| 452 | display: flex; | 466 | display: flex; |
| 453 | flex-direction: column; | 467 | flex-direction: column; |
| 454 | justify-content: center; | 468 | justify-content: center; |
| 455 | align-items: center; | 469 | align-items: center; |
| 456 | .T2 { | 470 | .T2 { |
| 457 | font-size: 24rpx; | 471 | font-size: 24rpx; |
| 458 | } | 472 | } |
| 459 | } | 473 | } |
| 460 | image { | 474 | image { |
| 461 | height: 56rpx; | 475 | height: 56rpx; |
| 462 | width: 72rpx; | 476 | width: 72rpx; |
| 463 | } | 477 | } |
| 464 | } | 478 | } |
| 465 | 479 | ||
| 466 | .order-user { | 480 | .order-user { |
| 467 | height: 228rpx; | 481 | height: 228rpx; |
| 468 | background: #ffffff; | 482 | background: #ffffff; |
| 469 | border-radius: 14rpx; | 483 | border-radius: 14rpx; |
| 470 | margin: 0 auto; | 484 | margin: 0 auto; |
| 471 | margin-top: 20rpx; | 485 | margin-top: 20rpx; |
| 472 | margin-bottom: 20rpx; | 486 | margin-bottom: 20rpx; |
| 473 | .order-user-head { | 487 | .order-user-head { |
| 474 | display: flex; | 488 | display: flex; |
| 475 | height: 108rpx; | 489 | height: 108rpx; |
| 476 | align-items: center; | 490 | align-items: center; |
| 477 | margin-left: 126rpx; | 491 | margin-left: 126rpx; |
| 478 | .p1 { | 492 | .p1 { |
| 479 | // font-family: PingFangSC-Regular; | 493 | // font-family: PingFangSC-Regular; |
| 480 | font-size: 14px; | 494 | font-size: 14px; |
| 481 | color: #333333; | 495 | color: #333333; |
| 482 | letter-spacing: -0.26px; | 496 | letter-spacing: -0.26px; |
| 483 | margin-right: 20rpx; | 497 | margin-right: 20rpx; |
| 484 | } | 498 | } |
| 485 | .p2 { | 499 | .p2 { |
| 486 | // font-family: PingFangSC-Regular; | 500 | // font-family: PingFangSC-Regular; |
| 487 | font-size: 14px; | 501 | font-size: 14px; |
| 488 | color: #999999; | 502 | color: #999999; |
| 489 | letter-spacing: -0.26px; | 503 | letter-spacing: -0.26px; |
| 490 | } | 504 | } |
| 491 | } | 505 | } |
| 492 | .order-user-body { | 506 | .order-user-body { |
| 493 | display: flex; | 507 | display: flex; |
| 494 | width: 100%; | 508 | width: 100%; |
| 495 | image { | 509 | image { |
| 496 | width: 24px; | 510 | width: 24px; |
| 497 | height: 26px; | 511 | height: 26px; |
| 498 | margin: 12rpx 32rpx 0 40rpx; | 512 | margin: 12rpx 32rpx 0 40rpx; |
| 499 | } | 513 | } |
| 500 | .p3 { | 514 | .p3 { |
| 501 | // font-family: PingFangSC-Semibold; | 515 | // font-family: PingFangSC-Semibold; |
| 502 | font-size: 14px; | 516 | font-size: 14px; |
| 503 | color: #333333; | 517 | color: #333333; |
| 504 | letter-spacing: -0.26px; | 518 | letter-spacing: -0.26px; |
| 505 | line-height: 70rpx; | 519 | line-height: 70rpx; |
| 506 | } | 520 | } |
| 507 | } | 521 | } |
| 508 | } | 522 | } |
| 509 | 523 | ||
| 510 | .order-info { | 524 | .order-info { |
| 511 | background-color: #fff; | 525 | background-color: #fff; |
| 512 | box-shadow: 0 0 20rpx 0 rgba(177, 128, 128, 0.06); | 526 | box-shadow: 0 0 20rpx 0 rgba(177, 128, 128, 0.06); |
| 513 | border-radius: 16rpx; | 527 | border-radius: 16rpx; |
| 514 | margin: 0 auto; | 528 | margin: 0 auto; |
| 515 | view { | 529 | view { |
| 516 | margin-left: 40rpx; | 530 | margin-left: 40rpx; |
| 517 | } | 531 | } |
| 518 | text { | 532 | text { |
| 519 | font-size: 14px; | 533 | font-size: 14px; |
| 520 | } | 534 | } |
| 521 | .order-info-head { | 535 | .order-info-head { |
| 522 | display: flex; | 536 | display: flex; |
| 523 | padding-top: 40rpx; | 537 | padding-top: 40rpx; |
| 524 | image { | 538 | image { |
| 525 | height: 188rpx; | 539 | height: 188rpx; |
| 526 | width: 188rpx; | 540 | width: 188rpx; |
| 527 | } | 541 | } |
| 528 | .order-info-head-r { | 542 | .order-info-head-r { |
| 529 | margin: 0; | 543 | margin: 0; |
| 530 | width: 368rpx; | 544 | width: 368rpx; |
| 531 | margin-left: 24rpx; | 545 | margin-left: 24rpx; |
| 532 | // margin-top: 40rpx; | 546 | // margin-top: 40rpx; |
| 533 | text { | 547 | text { |
| 534 | display: block; | 548 | display: block; |
| 535 | } | 549 | } |
| 536 | // .arrow{ | 550 | // .arrow{ |
| 537 | // width: 0; | 551 | // width: 0; |
| 538 | // height: 0; | 552 | // height: 0; |
| 539 | // border-left: 5px transparent; | 553 | // border-left: 5px transparent; |
| 540 | // border-right: 5px transparent; | 554 | // border-right: 5px transparent; |
| 541 | // border-top: 5px #979797; | 555 | // border-top: 5px #979797; |
| 542 | // border-bottom: 0 transparent; | 556 | // border-bottom: 0 transparent; |
| 543 | // border-style: solid; | 557 | // border-style: solid; |
| 544 | // position: relative; | 558 | // position: relative; |
| 545 | // // transform: scaleY(-1); | 559 | // // transform: scaleY(-1); |
| 546 | // } | 560 | // } |
| 547 | // .arrow::after{ | 561 | // .arrow::after{ |
| 548 | // content: ''; | 562 | // content: ''; |
| 549 | // position: absolute; | 563 | // position: absolute; |
| 550 | // top: -6.5px; | 564 | // top: -6.5px; |
| 551 | // left: -5px; | 565 | // left: -5px; |
| 552 | // border-left: 5px transparent; | 566 | // border-left: 5px transparent; |
| 553 | // border-right: 5px transparent; | 567 | // border-right: 5px transparent; |
| 554 | // border-top: 5px #FFFFFF; | 568 | // border-top: 5px #FFFFFF; |
| 555 | // border-bottom: 0 transparent; | 569 | // border-bottom: 0 transparent; |
| 556 | // border-style: solid; | 570 | // border-style: solid; |
| 557 | // } | 571 | // } |
| 558 | .p1 { | 572 | .p1 { |
| 559 | min-height: 40px; | 573 | min-height: 40px; |
| 560 | // font-family: PingFangSC-Regular; | 574 | // font-family: PingFangSC-Regular; |
| 561 | font-size: 14px; | 575 | font-size: 14px; |
| 562 | color: #333333; | 576 | color: #333333; |
| 563 | letter-spacing: -0.26px; | 577 | letter-spacing: -0.26px; |
| 564 | line-height: 18px; | 578 | line-height: 18px; |
| 565 | // line-height: 20px; | 579 | // line-height: 20px; |
| 566 | } | 580 | } |
| 567 | .p2 { | 581 | .p2 { |
| 568 | height: 34px; | 582 | height: 34px; |
| 569 | padding: 1px 0 3px 0; | 583 | padding: 1px 0 3px 0; |
| 570 | // font-family: PingFangSC-Regular; | 584 | // font-family: PingFangSC-Regular; |
| 571 | font-size: 12px; | 585 | font-size: 12px; |
| 572 | color: #999999; | 586 | color: #999999; |
| 573 | letter-spacing: -0.23px; | 587 | letter-spacing: -0.23px; |
| 574 | } | 588 | } |
| 575 | .infoText-bottom { | 589 | .infoText-bottom { |
| 576 | display: flex; | 590 | display: flex; |
| 577 | flex-direction: row; | 591 | flex-direction: row; |
| 578 | justify-content: flex-start; | 592 | justify-content: flex-start; |
| 579 | align-items: center; | 593 | align-items: center; |
| 580 | width: 100%; | 594 | width: 100%; |
| 581 | margin-left: 0; | 595 | margin-left: 0; |
| 582 | .markPrice { | 596 | .markPrice { |
| 583 | font-size: 14px; | 597 | font-size: 14px; |
| 584 | color: #ff6b4a; | 598 | color: #ff6b4a; |
| 585 | margin-right: 20rpx; | 599 | margin-right: 20rpx; |
| 586 | margin-left: 0rpx; | 600 | margin-left: 0rpx; |
| 587 | } | 601 | } |
| 588 | .buy-num { | 602 | .buy-num { |
| 589 | font-size: 12px; | 603 | font-size: 12px; |
| 590 | color: #999999; | 604 | color: #999999; |
| 605 | margin-left: 0; | ||
| 591 | } | 606 | } |
| 592 | } | 607 | } |
| 593 | } | 608 | } |
| 594 | } | 609 | } |
| 595 | // .order-info-goodsnum { | 610 | // .order-info-goodsnum { |
| 596 | // display: flex; | 611 | // display: flex; |
| 597 | // align-items: center; | 612 | // align-items: center; |
| 598 | // justify-content: flex-end; | 613 | // justify-content: flex-end; |
| 599 | // text { | 614 | // text { |
| 600 | // margin-right: 44rpx; | 615 | // margin-right: 44rpx; |
| 601 | // // ont-family: PingFangSC-Regular; | 616 | // // ont-family: PingFangSC-Regular; |
| 602 | // font-size: 12px; | 617 | // font-size: 12px; |
| 603 | // color: #999999; | 618 | // color: #999999; |
| 604 | // letter-spacing: -0.23px; | 619 | // letter-spacing: -0.23px; |
| 605 | // } | 620 | // } |
| 606 | // } | 621 | // } |
| 607 | .order-info-freight { | 622 | .order-info-freight { |
| 608 | display: block; | 623 | display: block; |
| 609 | margin-left: 40rpx; | 624 | margin-left: 40rpx; |
| 610 | margin-top: 22rpx; | 625 | margin-top: 22rpx; |
| 611 | .p1 { | 626 | .p1 { |
| 612 | // font-family: PingFangSC-Regular; | 627 | // font-family: PingFangSC-Regular; |
| 613 | font-size: 14px; | 628 | font-size: 14px; |
| 614 | color: #333333; | 629 | color: #333333; |
| 615 | letter-spacing: -0.26px; | 630 | letter-spacing: -0.26px; |
| 616 | line-height: 18px; | 631 | line-height: 18px; |
| 617 | margin-right: 24px; | 632 | margin-right: 24px; |
| 618 | } | 633 | } |
| 619 | .p2 { | 634 | .p2 { |
| 620 | // font-family: PingFangSC-Regular; | 635 | // font-family: PingFangSC-Regular; |
| 621 | font-size: 14px; | 636 | font-size: 14px; |
| 622 | color: #ff6b4a; | 637 | color: #ff6b4a; |
| 623 | letter-spacing: -0.26px; | 638 | letter-spacing: -0.26px; |
| 624 | } | 639 | } |
| 625 | } | 640 | } |
| 626 | .order-info-discount { | 641 | .order-info-discount { |
| 627 | display: block; | 642 | display: block; |
| 628 | margin-left: 40rpx; | 643 | margin-left: 40rpx; |
| 629 | margin-top: 24rpx; | 644 | margin-top: 24rpx; |
| 630 | .p1 { | 645 | .p1 { |
| 631 | // font-family: PingFangSC-Regular; | 646 | // font-family: PingFangSC-Regular; |
| 632 | font-size: 14px; | 647 | font-size: 14px; |
| 633 | color: #333333; | 648 | color: #333333; |
| 634 | letter-spacing: -0.26px; | 649 | letter-spacing: -0.26px; |
| 635 | line-height: 18px; | 650 | line-height: 18px; |
| 636 | margin-right: 24px; | 651 | margin-right: 24px; |
| 637 | } | 652 | } |
| 638 | .p2 { | 653 | .p2 { |
| 639 | // font-family: PingFangSC-Regular; | 654 | // font-family: PingFangSC-Regular; |
| 640 | font-size: 14px; | 655 | font-size: 14px; |
| 641 | color: #ff6b4a; | 656 | color: #ff6b4a; |
| 642 | letter-spacing: -0.26px; | 657 | letter-spacing: -0.26px; |
| 643 | } | 658 | } |
| 644 | } | 659 | } |
| 645 | .order-info-price { | 660 | .order-info-price { |
| 646 | display: block; | 661 | display: block; |
| 647 | margin-left: 40rpx; | 662 | margin-left: 40rpx; |
| 648 | margin-top: 24rpx; | 663 | margin-top: 24rpx; |
| 649 | .p1 { | 664 | .p1 { |
| 650 | // font-family: PingFangSC-Semibold; | 665 | // font-family: PingFangSC-Semibold; |
| 651 | font-size: 14px; | 666 | font-size: 14px; |
| 652 | color: #333333; | 667 | color: #333333; |
| 653 | letter-spacing: -0.26px; | 668 | letter-spacing: -0.26px; |
| 654 | line-height: 18px; | 669 | line-height: 18px; |
| 655 | margin-right: 24px; | 670 | margin-right: 24px; |
| 656 | } | 671 | } |
| 657 | .p2 { | 672 | .p2 { |
| 658 | // font-family: PingFangSC-Semibold; | 673 | // font-family: PingFangSC-Semibold; |
| 659 | font-size: 14px; | 674 | font-size: 14px; |
| 660 | color: #ff6b4a; | 675 | color: #ff6b4a; |
| 661 | letter-spacing: -0.26px; | 676 | letter-spacing: -0.26px; |
| 662 | } | 677 | } |
| 663 | } | 678 | } |
| 664 | .order-info-num { | 679 | .order-info-num { |
| 665 | display: block; | 680 | display: block; |
| 666 | margin-left: 40rpx; | 681 | margin-left: 40rpx; |
| 667 | margin-top: 44rpx; | 682 | margin-top: 44rpx; |
| 668 | text { | 683 | text { |
| 669 | // font-family: PingFangSC-Regular; | 684 | // font-family: PingFangSC-Regular; |
| 670 | font-size: 12px; | 685 | font-size: 12px; |
| 671 | color: #999999; | 686 | color: #999999; |
| 672 | letter-spacing: -0.23px; | 687 | letter-spacing: -0.23px; |
| 673 | } | 688 | } |
| 674 | } | 689 | } |
| 675 | .order-info-time { | 690 | .order-info-time { |
| 676 | display: block; | 691 | display: block; |
| 677 | margin: 8rpx 0 48rpx 40rpx; | 692 | margin: 8rpx 0 48rpx 40rpx; |
| 678 | text { | 693 | text { |
| 679 | // font-family: PingFangSC-Regular; | 694 | // font-family: PingFangSC-Regular; |
| 680 | font-size: 12px; | 695 | font-size: 12px; |
| 681 | color: #999999; | 696 | color: #999999; |
| 682 | letter-spacing: -0.23px; | 697 | letter-spacing: -0.23px; |
| 683 | } | 698 | } |
| 684 | } | 699 | } |
| 685 | .order-info-hr { | 700 | .order-info-hr { |
| 686 | width: 520rpx; | 701 | width: 520rpx; |
| 687 | height: 1px; | 702 | height: 1px; |
| 688 | background-color: #e9e9e9; | 703 | background-color: #e9e9e9; |
| 689 | margin-bottom: 20rpx; | 704 | margin-bottom: 20rpx; |
| 690 | } | 705 | } |
| 691 | .order-info-contact { | 706 | .order-info-contact { |
| 692 | display: flex; | 707 | display: flex; |
| 693 | padding-bottom: 28rpx; | 708 | padding-bottom: 28rpx; |
| 694 | image { | 709 | image { |
| 695 | width: 19px; | 710 | width: 19px; |
| 696 | height: 16px; | 711 | height: 16px; |
| 697 | } | 712 | } |
| 698 | text { | 713 | button { |
| 699 | // font-family: PingFangSC-Regular; | 714 | // font-family: PingFangSC-Regular; |
| 715 | border: none; | ||
| 716 | border-radius: 0; | ||
| 717 | text-align: left; | ||
| 700 | margin-left: 20rpx; | 718 | margin-left: 20rpx; |
| 701 | font-size: 14px; | 719 | font-size: 14px; |
| 702 | color: #333333; | 720 | color: #333333; |
| 703 | letter-spacing: -0.26px; | 721 | letter-spacing: -0.26px; |
| 704 | line-height: 18px; | 722 | line-height: 18px; |
| 723 | background-color: #fff; | ||
| 724 | padding: 0; | ||
| 725 | &::after { | ||
| 726 | border: 0; | ||
| 727 | } | ||
| 705 | } | 728 | } |
| 706 | } | 729 | } |
| 707 | } | 730 | } |
| 708 | 731 | ||
| 709 | .order-confim { | 732 | .order-confim { |
| 710 | display: flex; | 733 | display: flex; |
| 711 | align-items: center; | 734 | align-items: center; |
| 712 | justify-content: flex-end; | 735 | justify-content: flex-end; |
| 713 | // z-index: 999; | 736 | // z-index: 999; |
| 714 | width: 100%; | 737 | width: 100%; |
| 715 | height: 112rpx; | 738 | height: 112rpx; |
| 716 | position: fixed; | 739 | position: fixed; |
| 717 | bottom: 0; | 740 | bottom: 0; |
| 718 | background: #ffffff; | 741 | background: #ffffff; |
| 719 | button { | 742 | button { |
| 720 | width: 204rpx; | 743 | width: 204rpx; |
| 721 | height: 80rpx; | 744 | height: 80rpx; |
| 722 | border: 1px solid #ff6b4a; | 745 | border: 1px solid #ff6b4a; |
| 723 | border-radius: 40rpx; | 746 | border-radius: 40rpx; |
| 724 | font-size: 32rpx; | 747 | font-size: 32rpx; |
| 725 | letter-spacing: -0.3px; | 748 | letter-spacing: -0.3px; |
| 726 | margin-right: 0; | 749 | margin-right: 0; |
| 727 | } | 750 | } |
| 728 | .b1 { | 751 | .b1 { |
| 729 | // font-family: PingFangSC-Regular; | 752 | // font-family: PingFangSC-Regular; |
| 730 | color: #ff6b4a; | 753 | color: #ff6b4a; |
| 731 | background-color: #ffffff; | 754 | background-color: #ffffff; |
| 732 | } | 755 | } |
| 733 | .b2 { | 756 | .b2 { |
| 734 | // font-family: PingFangSC-Regular; | 757 | // font-family: PingFangSC-Regular; |
| 735 | background-color: #ff6b4a; | 758 | background-color: #ff6b4a; |
| 736 | color: #ffffff; | 759 | color: #ffffff; |
| 737 | margin: 0 26rpx 0 20rpx; | 760 | margin: 0 26rpx 0 20rpx; |
| 738 | } | 761 | } |
| 739 | } | 762 | } |
| 740 | </style> | 763 | </style> |
| 741 | 764 |
src/pages/user/user.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="wrap"> | 2 | <view class="wrap"> |
| 3 | <!-- 弹窗 --> | 3 | <!-- 弹窗 --> |
| 4 | <uni-popup | 4 | <uni-popup |
| 5 | ref="popup" | 5 | ref="popup" |
| 6 | type="center" | 6 | type="center" |
| 7 | > | 7 | > |
| 8 | <!-- 给一个左边弹窗的样式 --> | 8 | <!-- 给一个左边弹窗的样式 --> |
| 9 | <!-- 关闭弹窗按钮 --> | 9 | <!-- 关闭弹窗按钮 --> |
| 10 | <view | 10 | <view |
| 11 | class="closeBtn" | 11 | class="closeBtn" |
| 12 | @tap="this.$refs.popup.close()" | 12 | @tap="this.$refs.popup.close()" |
| 13 | >x</view> | 13 | >x</view> |
| 14 | <view | 14 | <view |
| 15 | class="popUpWrap" | 15 | class="popUpWrap" |
| 16 | v-if="whichTap==0" | 16 | v-if="whichTap==0" |
| 17 | > | 17 | > |
| 18 | <text>这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入驻。</text> | 18 | <text>这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入驻。</text> |
| 19 | 19 | ||
| 20 | <!-- 左 --> | 20 | <!-- 左 --> |
| 21 | <!-- <image class="glassInfo" src="../../static/img/myOpticsData/glassInfo.png" v-if="whichTap == 0" mode="aspectFit"></image> --> | 21 | <!-- <image class="glassInfo" src="../../static/img/myOpticsData/glassInfo.png" v-if="whichTap == 0" mode="aspectFit"></image> --> |
| 22 | <!-- 右 --> | 22 | <!-- 右 --> |
| 23 | <!-- <image class="dataInfo" src="../../static/img/myOpticsData/dataInfo.png" v-else mode="aspectFit"></image> --> | 23 | <!-- <image class="dataInfo" src="../../static/img/myOpticsData/dataInfo.png" v-else mode="aspectFit"></image> --> |
| 24 | </view> | 24 | </view> |
| 25 | <view | 25 | <view |
| 26 | class="popUpWrap" | 26 | class="popUpWrap" |
| 27 | v-if="whichTap==1" | 27 | v-if="whichTap==1" |
| 28 | > | 28 | > |
| 29 | <text>本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号。</text> | 29 | <text>本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号。</text> |
| 30 | </view> | 30 | </view> |
| 31 | <view | 31 | <view |
| 32 | class="popUpWrap" | 32 | class="popUpWrap" |
| 33 | v-if="whichTap==2" | 33 | v-if="whichTap==2" |
| 34 | > | 34 | > |
| 35 | <button @tap="chatOur(1)">客服1</button> | 35 | <button @tap="chatOur(1)">客服1</button> |
| 36 | <button @tap="chatOur(2)">客服2</button> | 36 | <button @tap="chatOur(2)">客服2</button> |
| 37 | </view> | 37 | </view> |
| 38 | </uni-popup> | 38 | </uni-popup> |
| 39 | <!-- <scroll-view | 39 | <!-- <scroll-view |
| 40 | enable-flex | 40 | enable-flex |
| 41 | @scrolltolower="handleScrolltolower" | 41 | @scrolltolower="handleScrolltolower" |
| 42 | scroll-y | 42 | scroll-y |
| 43 | style="height: 1000px;" | 43 | style="height: 1000px;" |
| 44 | > --> | 44 | > --> |
| 45 | <view | 45 | <view |
| 46 | v-if="isAuth" | 46 | v-if="isAuth" |
| 47 | class="content" | 47 | class="content" |
| 48 | > | 48 | > |
| 49 | <view class="userInfo"> | 49 | <view class="userInfo"> |
| 50 | <view class="info"> | 50 | <view class="info"> |
| 51 | <image | 51 | <image |
| 52 | :src="headerphoto" | 52 | :src="headerphoto" |
| 53 | mode="aspectFill" | 53 | mode="aspectFill" |
| 54 | ></image> | 54 | ></image> |
| 55 | <view class="infoText"> | 55 | <view class="infoText"> |
| 56 | <text class="userName">{{nickName}}</text> | 56 | <text class="userName">{{nickName}}</text> |
| 57 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| 59 | <!-- <view class="service"> | 59 | <!-- <view class="service"> |
| 60 | <image src="../../static/serviceLogo.png" mode="aspectFill"></image> | 60 | <image src="../../static/serviceLogo.png" mode="aspectFill"></image> |
| 61 | </view> --> | 61 | </view> --> |
| 62 | </view> | 62 | </view> |
| 63 | <view | 63 | <view |
| 64 | class="myOpticsData" | 64 | class="myOpticsData" |
| 65 | @tap="toOpticsData" | 65 | @tap="toOpticsData" |
| 66 | > | 66 | > |
| 67 | <view class="left"> | 67 | <view class="left"> |
| 68 | <image | 68 | <image |
| 69 | src="../../static/img/user/dataWrite.png" | 69 | src="../../static/img/user/dataWrite.png" |
| 70 | mode="aspectFit" | 70 | mode="aspectFit" |
| 71 | ></image> | 71 | ></image> |
| 72 | <text>验光数据</text> | 72 | <text>验光数据</text> |
| 73 | </view> | 73 | </view> |
| 74 | <image | 74 | <image |
| 75 | src="../../static/right.png" | 75 | src="../../static/right.png" |
| 76 | mode="aspectFit" | 76 | mode="aspectFit" |
| 77 | ></image> | 77 | ></image> |
| 78 | </view> | 78 | </view> |
| 79 | <view class="myOrder"> | 79 | <view class="myOrder"> |
| 80 | <view class="orderHeader" @click="toMyOrder('10')" > | 80 | <view |
| 81 | class="orderHeader" | ||
| 82 | @click="toMyOrder('10')" | ||
| 83 | > | ||
| 81 | <text>我的订单</text> | 84 | <text>我的订单</text> |
| 82 | <view class="btn"> | 85 | <view class="btn"> |
| 83 | 全部 | 86 | 全部 |
| 84 | <image | 87 | <image |
| 85 | src="../../static/right.png" | 88 | src="../../static/right.png" |
| 86 | mode="aspectFit" | 89 | mode="aspectFit" |
| 87 | ></image> | 90 | ></image> |
| 88 | </view> | 91 | </view> |
| 89 | </view> | 92 | </view> |
| 90 | <view class="orderBody"> | 93 | <view class="orderBody"> |
| 91 | <view | 94 | <view |
| 92 | class="item waitPay" | 95 | class="item waitPay" |
| 93 | @click="toMyOrder('0')" | 96 | @click="toMyOrder('0')" |
| 94 | > | 97 | > |
| 95 | <image | 98 | <image |
| 96 | src="../../static/img/user/waitDeliver.png" | 99 | src="../../static/img/user/waitDeliver.png" |
| 97 | mode="aspectFit" | 100 | mode="aspectFit" |
| 98 | ></image> | 101 | ></image> |
| 99 | <text>待付款</text> | 102 | <text>待付款</text> |
| 100 | </view> | 103 | </view> |
| 101 | <view | 104 | <view |
| 102 | class="item waitDeliver" | 105 | class="item waitDeliver" |
| 103 | @click="toMyOrder('1')" | 106 | @click="toMyOrder('1')" |
| 104 | > | 107 | > |
| 105 | <image | 108 | <image |
| 106 | src="../../static/img/user/waitPay.png" | 109 | src="../../static/img/user/waitPay.png" |
| 107 | mode="aspectFit" | 110 | mode="aspectFit" |
| 108 | ></image> | 111 | ></image> |
| 109 | <text>待收货</text> | 112 | <text>待收货</text> |
| 110 | </view> | 113 | </view> |
| 111 | <view | 114 | <view |
| 112 | class="item waitReceive" | 115 | class="item waitReceive" |
| 113 | @click="toMyOrder('2')" | 116 | @click="toMyOrder('2')" |
| 114 | > | 117 | > |
| 115 | <image | 118 | <image |
| 116 | src="../../static/img/user/waitReceive.png" | 119 | src="../../static/img/user/waitReceive.png" |
| 117 | mode="aspectFit" | 120 | mode="aspectFit" |
| 118 | ></image> | 121 | ></image> |
| 119 | <text>已完成</text> | 122 | <text>已完成</text> |
| 120 | </view> | 123 | </view> |
| 121 | <!-- <view class="item service" @click="toMyOrder('3')"> | 124 | <!-- <view class="item service" @click="toMyOrder('3')"> |
| 122 | <image src="../../static/img/user/refound.png" mode="aspectFit"></image> | 125 | <image src="../../static/img/user/refound.png" mode="aspectFit"></image> |
| 123 | <text>已评价</text> | 126 | <text>已评价</text> |
| 124 | </view> --> | 127 | </view> --> |
| 125 | </view> | 128 | </view> |
| 126 | </view> | 129 | </view> |
| 127 | <view class="someItem"> | 130 | <view class="someItem"> |
| 128 | <!-- <view class="item"> | 131 | <!-- <view class="item"> |
| 129 | <view class="left"> | 132 | <view class="left"> |
| 130 | <image src="../../static/img/user/shouyi.png" mode="aspectFit"></image> | 133 | <image src="../../static/img/user/shouyi.png" mode="aspectFit"></image> |
| 131 | <text>推广记录与收益</text> | 134 | <text>推广记录与收益</text> |
| 132 | </view> | 135 | </view> |
| 133 | <image src="../../static/right.png" mode="aspectFit"></image> | 136 | <image src="../../static/right.png" mode="aspectFit"></image> |
| 134 | </view> --> | 137 | </view> --> |
| 135 | <view | 138 | <view |
| 136 | @tap="toAddress" | 139 | @tap="toAddress" |
| 137 | class="item" | 140 | class="item" |
| 138 | > | 141 | > |
| 139 | <image | 142 | <image |
| 140 | src="../../static/address-icon.png" | 143 | src="../../static/address-icon.png" |
| 141 | mode="aspectFit" | 144 | mode="aspectFit" |
| 142 | ></image> | 145 | ></image> |
| 143 | <view class="left"> | 146 | <view class="left"> |
| 144 | <text>地址管理</text> | 147 | <text>地址管理</text> |
| 145 | <image | 148 | <image |
| 146 | class="image2" | 149 | class="image2" |
| 147 | src="../../static/right.png" | 150 | src="../../static/right.png" |
| 148 | mode="aspectFit" | 151 | mode="aspectFit" |
| 149 | ></image> | 152 | ></image> |
| 150 | </view> | 153 | </view> |
| 151 | 154 | ||
| 152 | </view> | 155 | </view> |
| 153 | <view | 156 | <view |
| 154 | @tap="introduce" | 157 | @tap="introduce" |
| 155 | class="item" | 158 | class="item" |
| 156 | > | 159 | > |
| 157 | <image | 160 | <image |
| 158 | src="../../static/img/user/introduce.png" | 161 | src="../../static/img/user/introduce.png" |
| 159 | mode="aspectFit" | 162 | mode="aspectFit" |
| 160 | ></image> | 163 | ></image> |
| 161 | <view class="left"> | 164 | <view class="left"> |
| 162 | <text>系统介绍</text> | 165 | <text>系统介绍</text> |
| 163 | <image | 166 | <image |
| 164 | src="../../static/right.png" | 167 | src="../../static/right.png" |
| 165 | mode="aspectFit" | 168 | mode="aspectFit" |
| 166 | ></image> | 169 | ></image> |
| 167 | </view> | 170 | </view> |
| 168 | </view> | 171 | </view> |
| 169 | <view | 172 | <view |
| 170 | @tap="joinUs" | 173 | @tap="joinUs" |
| 171 | class="item" | 174 | class="item" |
| 172 | > | 175 | > |
| 173 | <image | 176 | <image |
| 174 | src="../../static/img/user/joinUs.png" | 177 | src="../../static/img/user/joinUs.png" |
| 175 | mode="aspectFit" | 178 | mode="aspectFit" |
| 176 | ></image> | 179 | ></image> |
| 177 | <view class="left"> | 180 | <view class="left"> |
| 178 | <text>加入我们</text> | 181 | <text>加入我们</text> |
| 179 | <image | 182 | <image |
| 180 | src="../../static/right.png" | 183 | src="../../static/right.png" |
| 181 | mode="aspectFit" | 184 | mode="aspectFit" |
| 182 | ></image> | 185 | ></image> |
| 183 | </view> | 186 | </view> |
| 184 | </view> | 187 | </view> |
| 185 | <view class="item"> | 188 | <view class="item"> |
| 186 | <image | 189 | <image |
| 187 | src="../../static/img/user/service.png" | 190 | src="../../static/img/user/service.png" |
| 188 | mode="aspectFit" | 191 | mode="aspectFit" |
| 189 | ></image> | 192 | ></image> |
| 190 | <view class="left lastLeft"> | 193 | <view class="left lastLeft"> |
| 191 | <text>联系客服</text> | 194 | <button |
| 195 | class="contact" | ||
| 196 | open-type="contact" | ||
| 197 | >联系客服</button> | ||
| 192 | <image | 198 | <image |
| 193 | src="../../static/right.png" | 199 | src="../../static/right.png" |
| 194 | mode="aspectFit" | 200 | mode="aspectFit" |
| 195 | ></image> | 201 | ></image> |
| 196 | </view> | 202 | </view> |
| 197 | </view> | 203 | </view> |
| 198 | </view> | 204 | </view> |
| 199 | <view class="recommend"> | 205 | <view class="recommend"> |
| 200 | <view class="title"> | 206 | <view class="title"> |
| 201 | <view class="line"></view> | 207 | <view class="line"></view> |
| 202 | <view class="text">精选推荐</view> | 208 | <view class="text">精选推荐</view> |
| 203 | <view class="line"></view> | 209 | <view class="line"></view> |
| 204 | </view> | 210 | </view> |
| 205 | <!-- 商品列表 --> | 211 | <!-- 商品列表 --> |
| 206 | <view class="goods-list"> | 212 | <view class="goods-list"> |
| 207 | <!-- <scroll-view | 213 | <!-- <scroll-view |
| 208 | enable-flex | 214 | enable-flex |
| 209 | @scrolltolower="handleScrolltolower" | 215 | @scrolltolower="handleScrolltolower" |
| 210 | scroll-y | 216 | scroll-y |
| 211 | class="product-list" | 217 | class="product-list" |
| 212 | > --> | 218 | > --> |
| 213 | <view class="product-list"> | 219 | <view class="product-list"> |
| 214 | <view | 220 | <view |
| 215 | class="product" | 221 | class="product" |
| 216 | v-for="(item, index) in userRecommandList" | 222 | v-for="(item, index) in userRecommandList" |
| 217 | :key="index" | 223 | :key="index" |
| 218 | > | 224 | > |
| 219 | <Card | 225 | <Card |
| 220 | :goods="item" | 226 | :goods="item" |
| 221 | :scrollTop="scrollTop" | 227 | :scrollTop="scrollTop" |
| 222 | :viewHeight="viewHeight" | 228 | :viewHeight="viewHeight" |
| 223 | ></Card> | 229 | ></Card> |
| 224 | </view> | 230 | </view> |
| 225 | </view> | 231 | </view> |
| 226 | <!-- </scroll-view> --> | 232 | <!-- </scroll-view> --> |
| 227 | <view class="loading-text">{{loadingText}}</view> | 233 | <view class="loading-text">{{loadingText}}</view> |
| 228 | </view> | 234 | </view> |
| 229 | </view> | 235 | </view> |
| 230 | </view> | 236 | </view> |
| 231 | <view | 237 | <view |
| 232 | v-else | 238 | v-else |
| 233 | class="auth" | 239 | class="auth" |
| 234 | > | 240 | > |
| 235 | <view class="icon"></view> | 241 | <view class="icon"></view> |
| 236 | <view class="divider"></view> | 242 | <view class="divider"></view> |
| 237 | <view class="title">申请获取以下权限</view> | 243 | <view class="title">申请获取以下权限</view> |
| 238 | <view class="text">获得您的公开信息(昵称、头像等)</view> | 244 | <view class="text">获得您的公开信息(昵称、头像等)</view> |
| 239 | <button | 245 | <button |
| 240 | type="primary" | 246 | type="primary" |
| 241 | open-type="getUserInfo" | 247 | open-type="getUserInfo" |
| 242 | @getuserinfo="onGotUserInfo" | 248 | @getuserinfo="onGotUserInfo" |
| 243 | >授权登陆</button> | 249 | >授权登陆</button> |
| 244 | </view> | 250 | </view> |
| 245 | <!-- </scroll-view> --> | 251 | <!-- </scroll-view> --> |
| 246 | </view> | 252 | </view> |
| 247 | </template> | 253 | </template> |
| 248 | 254 | ||
| 249 | <script> | 255 | <script> |
| 250 | import Card from '@/components/CommodityCard/CommodityCard.vue' | 256 | import Card from '@/components/CommodityCard/CommodityCard.vue' |
| 251 | import store from '@/store' | 257 | import store from '@/store' |
| 252 | import UniPopup from '@/components/UniPopup/uni-popup.vue' | 258 | import UniPopup from '@/components/UniPopup/uni-popup.vue' |
| 253 | 259 | ||
| 254 | export default { | 260 | export default { |
| 255 | components: { | 261 | components: { |
| 256 | Card, | 262 | Card, |
| 257 | UniPopup, | 263 | UniPopup, |
| 258 | }, | 264 | }, |
| 259 | data() { | 265 | data() { |
| 260 | return { | 266 | return { |
| 261 | isAuth: true, // 是否显示授权页面, | 267 | isAuth: true, // 是否显示授权页面, |
| 262 | pagesnum: 1, // 分页请求初始值 | 268 | pagesnum: 1, // 分页请求初始值 |
| 263 | whichTap: 0, // 弹窗渲染选择条件 | 269 | whichTap: 0, // 弹窗渲染选择条件 |
| 264 | loadingText: '到底了', | 270 | loadingText: '到底了', |
| 265 | scrollTop: 0, | 271 | scrollTop: 0, |
| 266 | viewHeight: uni.getSystemInfoSync().windowHeight, | 272 | viewHeight: uni.getSystemInfoSync().windowHeight, |
| 267 | } | 273 | } |
| 268 | }, | 274 | }, |
| 269 | onPageScroll({ scrollTop }) { | 275 | onPageScroll({ scrollTop }) { |
| 270 | // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件 | 276 | // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件 |
| 271 | this.scrollTop = scrollTop | 277 | this.scrollTop = scrollTop |
| 272 | }, | 278 | }, |
| 273 | onLoad() { | 279 | onLoad() { |
| 274 | const that = this | 280 | const that = this |
| 275 | // 判断是否授权 | 281 | // 判断是否授权 |
| 276 | uni.getSetting({ | 282 | uni.getSetting({ |
| 277 | success(res) { | 283 | success(res) { |
| 278 | console.log('authSetting', res.authSetting) | 284 | console.log('authSetting', res.authSetting) |
| 279 | if (res.authSetting['scope.userInfo'] === true) { | 285 | if (res.authSetting['scope.userInfo'] === true) { |
| 280 | that.isAuth = true | 286 | that.isAuth = true |
| 281 | } else { | 287 | } else { |
| 282 | that.isAuth = false | 288 | that.isAuth = false |
| 283 | } | 289 | } |
| 284 | }, | 290 | }, |
| 285 | }) | 291 | }) |
| 286 | store.dispatch('userRecommand/getRecommandList', { | 292 | store.dispatch('userRecommand/getRecommandList', { |
| 287 | uid: that.$store.state.user.userInfo.uid, | 293 | uid: that.$store.state.user.userInfo.uid, |
| 288 | openid: that.$store.state.user.userInfo.openid, | 294 | openid: that.$store.state.user.userInfo.openid, |
| 289 | page: that.pagesnum, | 295 | page: that.pagesnum, |
| 290 | }) | 296 | }) |
| 291 | }, | 297 | }, |
| 292 | onReachBottom() { | 298 | onReachBottom() { |
| 293 | // console.log('usr-my',this.$store.state.user.userInfo) | 299 | // console.log('usr-my',this.$store.state.user.userInfo) |
| 294 | this.pagesnum++ | 300 | this.pagesnum++ |
| 295 | store.dispatch('userRecommand/getRecommandList', { | 301 | store.dispatch('userRecommand/getRecommandList', { |
| 296 | uid: this.$store.state.user.userInfo.uid, | 302 | uid: this.$store.state.user.userInfo.uid, |
| 297 | openid: this.$store.state.user.userInfo.openid, | 303 | openid: this.$store.state.user.userInfo.openid, |
| 298 | page: this.pagesnum, | 304 | page: this.pagesnum, |
| 299 | }) | 305 | }) |
| 300 | }, | 306 | }, |
| 301 | computed: { | 307 | computed: { |
| 302 | nickName() { | 308 | nickName() { |
| 303 | return this.$store.state.user.userInfo.nickName | 309 | return this.$store.state.user.userInfo.nickName |
| 304 | }, | 310 | }, |
| 305 | headerphoto() { | 311 | headerphoto() { |
| 306 | return this.$store.state.user.userInfo.headerphoto | 312 | return this.$store.state.user.userInfo.headerphoto |
| 307 | }, | 313 | }, |
| 308 | userRecommandList() { | 314 | userRecommandList() { |
| 309 | console.log('userRecommandList=====>', this.$store.state.userRecommand.recommandList) | 315 | console.log('userRecommandList=====>', this.$store.state.userRecommand.recommandList) |
| 310 | return this.$store.state.userRecommand.recommandList | 316 | return this.$store.state.userRecommand.recommandList |
| 311 | }, | 317 | }, |
| 312 | }, | 318 | }, |
| 313 | methods: { | 319 | methods: { |
| 314 | // 弹窗 | 320 | // 弹窗 |
| 315 | changeTap(item) { | 321 | changeTap(item) { |
| 316 | this.whichTap = item | 322 | this.whichTap = item |
| 317 | this.$refs.popup.open() | 323 | this.$refs.popup.open() |
| 318 | }, | 324 | }, |
| 319 | chatOur(item) { | 325 | chatOur(item) { |
| 320 | if (item === 1) { | 326 | if (item === 1) { |
| 321 | uni.makePhoneCall({ | 327 | uni.makePhoneCall({ |
| 322 | phoneNumber: 13376189297, // 客服1 电话 | 328 | phoneNumber: 13376189297, // 客服1 电话 |
| 323 | }) | 329 | }) |
| 324 | } else { | 330 | } else { |
| 325 | uni.makePhoneCall({ | 331 | uni.makePhoneCall({ |
| 326 | phoneNumber: 18014995101, // 客服2 电话 | 332 | phoneNumber: 18014995101, // 客服2 电话 |
| 327 | }) | 333 | }) |
| 328 | } | 334 | } |
| 329 | }, | 335 | }, |
| 330 | // 授权 | 336 | // 授权 |
| 331 | onGotUserInfo(e) { | 337 | onGotUserInfo(e) { |
| 332 | if (e.detail.errMsg === 'getUserInfo:ok') { | 338 | if (e.detail.errMsg === 'getUserInfo:ok') { |
| 333 | const { fromInfo } = this.$store.state.user | 339 | const { fromInfo } = this.$store.state.user |
| 334 | // 用户授权成功 | 340 | // 用户授权成功 |
| 335 | store.dispatch('user/getUserInfo', fromInfo) | 341 | store.dispatch('user/getUserInfo', fromInfo) |
| 336 | this.isAuth = true | 342 | this.isAuth = true |
| 337 | } | 343 | } |
| 338 | }, | 344 | }, |
| 339 | toAddress() { | 345 | toAddress() { |
| 340 | uni.navigateTo({ | 346 | uni.navigateTo({ |
| 341 | url: '../address/addressList', | 347 | url: '../address/addressList', |
| 342 | success: res => {}, | 348 | success: res => {}, |
| 343 | fail: () => {}, | 349 | fail: () => {}, |
| 344 | complete: () => {}, | 350 | complete: () => {}, |
| 345 | }) | 351 | }) |
| 346 | }, | 352 | }, |
| 347 | introduce() { | 353 | introduce() { |
| 348 | uni.showModal({ | 354 | uni.showModal({ |
| 349 | content: '这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入住。', | 355 | content: '这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入住。', |
| 350 | showCancel: false, | 356 | showCancel: false, |
| 351 | }) | 357 | }) |
| 352 | }, | 358 | }, |
| 353 | joinUs() { | 359 | joinUs() { |
| 354 | uni.showModal({ | 360 | uni.showModal({ |
| 355 | content: '本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号', | 361 | content: '本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号', |
| 356 | showCancel: false, | 362 | showCancel: false, |
| 357 | }) | 363 | }) |
| 358 | }, | 364 | }, |
| 359 | toMyOrder(status) { | 365 | toMyOrder(status) { |
| 360 | uni.navigateTo({ | 366 | uni.navigateTo({ |
| 361 | url: `../myOrder/myOrder?status=${status}`, | 367 | url: `../myOrder/myOrder?status=${status}`, |
| 362 | success: res => {}, | 368 | success: res => {}, |
| 363 | fail: () => {}, | 369 | fail: () => {}, |
| 364 | complete: () => {}, | 370 | complete: () => {}, |
| 365 | }) | 371 | }) |
| 366 | }, | 372 | }, |
| 367 | toOpticsData() { | 373 | toOpticsData() { |
| 368 | uni.navigateTo({ | 374 | uni.navigateTo({ |
| 369 | url: '../addOpticsData/addOpticsData', | 375 | url: '../addOpticsData/addOpticsData', |
| 370 | }) | 376 | }) |
| 371 | }, | 377 | }, |
| 372 | }, | 378 | }, |
| 373 | } | 379 | } |
| 374 | </script> | 380 | </script> |
| 375 | 381 | ||
| 376 | <style lang="scss"> | 382 | <style lang="scss"> |
| 383 | // 联系客服 | ||
| 384 | .contact { | ||
| 385 | border: 0; | ||
| 386 | padding: 0; | ||
| 387 | font-size: 14px; | ||
| 388 | text-align: left; | ||
| 389 | background-color: #fff; | ||
| 390 | color: #333; | ||
| 391 | margin: 0; | ||
| 392 | padding-right: 450rpx; | ||
| 393 | &::after { | ||
| 394 | border: 0; | ||
| 395 | } | ||
| 396 | } | ||
| 377 | .warp { | 397 | .warp { |
| 378 | font-size: 24rpx; | 398 | font-size: 24rpx; |
| 379 | background-color: #f2f2f2; | 399 | background-color: #f2f2f2; |
| 380 | height: 100vh; | 400 | height: 100vh; |
| 381 | } | 401 | } |
| 382 | .content { | 402 | .content { |
| 383 | display: flex; | 403 | display: flex; |
| 384 | flex-direction: column; | 404 | flex-direction: column; |
| 385 | align-items: center; | 405 | align-items: center; |
| 386 | justify-content: center; | 406 | justify-content: center; |
| 387 | background-color: #f2f2f2; | 407 | background-color: #f2f2f2; |
| 388 | } | 408 | } |
| 389 | .userInfo { | 409 | .userInfo { |
| 390 | background-image: linear-gradient(270deg, #f79067 0%, #ff5f3b 66%); | 410 | background-image: linear-gradient(270deg, #f79067 0%, #ff5f3b 66%); |
| 391 | width: 100%; | 411 | width: 100%; |
| 392 | height: 240rpx; | 412 | height: 240rpx; |
| 393 | color: #ffffff; | 413 | color: #ffffff; |
| 394 | padding: 60rpx 82rpx 80rpx 44rpx; | 414 | padding: 60rpx 82rpx 80rpx 44rpx; |
| 395 | box-sizing: border-box; | 415 | box-sizing: border-box; |
| 396 | display: flex; | 416 | display: flex; |
| 397 | flex-direction: row; | 417 | flex-direction: row; |
| 398 | justify-content: space-between; | 418 | justify-content: space-between; |
| 399 | align-items: flex-start; | 419 | align-items: flex-start; |
| 400 | .info { | 420 | .info { |
| 401 | display: flex; | 421 | display: flex; |
| 402 | flex-direction: row; | 422 | flex-direction: row; |
| 403 | justify-content: space-between; | 423 | justify-content: space-between; |
| 404 | align-items: center; | 424 | align-items: center; |
| 405 | image { | 425 | image { |
| 406 | border-radius: 50rpx; | 426 | border-radius: 50rpx; |
| 407 | height: 100rpx; | 427 | height: 100rpx; |
| 408 | width: 100rpx; | 428 | width: 100rpx; |
| 409 | margin-right: 40rpx; | 429 | margin-right: 40rpx; |
| 410 | } | 430 | } |
| 411 | .infoText { | 431 | .infoText { |
| 412 | display: flex; | 432 | display: flex; |
| 413 | flex-direction: column; | 433 | flex-direction: column; |
| 414 | justify-content: space-between; | 434 | justify-content: space-between; |
| 415 | align-items: flex-scetart; | 435 | align-items: flex-scetart; |
| 416 | .userName { | 436 | .userName { |
| 417 | font-size: 18px; | 437 | font-size: 18px; |
| 418 | color: #ffffff; | 438 | color: #ffffff; |
| 419 | margin-bottom: 8rpx; | 439 | margin-bottom: 8rpx; |
| 420 | } | 440 | } |
| 421 | .nickName { | 441 | .nickName { |
| 422 | font-size: 12px; | 442 | font-size: 12px; |
| 423 | color: #ffffff; | 443 | color: #ffffff; |
| 424 | } | 444 | } |
| 425 | } | 445 | } |
| 426 | } | 446 | } |
| 427 | // .service { | 447 | // .service { |
| 428 | // margin-top: 20rpx; | 448 | // margin-top: 20rpx; |
| 429 | // image { | 449 | // image { |
| 430 | // height: 36rpx; | 450 | // height: 36rpx; |
| 431 | // width: 36rpx; | 451 | // width: 36rpx; |
| 432 | // } | 452 | // } |
| 433 | // } | 453 | // } |
| 434 | } | 454 | } |
| 435 | .myOpticsData { | 455 | .myOpticsData { |
| 436 | width: 670rpx; | 456 | width: 670rpx; |
| 437 | height: 120rpx; | 457 | height: 120rpx; |
| 438 | background-color: #ffffff; | 458 | background-color: #ffffff; |
| 439 | border-radius: 6px; | 459 | border-radius: 6px; |
| 440 | box-shadow: 1px 1px 7px 0 rgba(133, 107, 107, 0.1); | 460 | box-shadow: 1px 1px 7px 0 rgba(133, 107, 107, 0.1); |
| 441 | position: relative; | 461 | position: relative; |
| 442 | bottom: 44rpx; | 462 | bottom: 44rpx; |
| 443 | padding: 40rpx; | 463 | padding: 40rpx; |
| 444 | box-sizing: border-box; | 464 | box-sizing: border-box; |
| 445 | display: flex; | 465 | display: flex; |
| 446 | justify-content: space-between; | 466 | justify-content: space-between; |
| 447 | align-items: center; | 467 | align-items: center; |
| 448 | .left { | 468 | .left { |
| 449 | font-size: 14px; | 469 | font-size: 14px; |
| 450 | color: #333333; | 470 | color: #333333; |
| 451 | display: flex; | 471 | display: flex; |
| 452 | align-items: center; | 472 | align-items: center; |
| 453 | image { | 473 | image { |
| 454 | margin-right: 32rpx; | 474 | margin-right: 32rpx; |
| 455 | width: 40rpx; | 475 | width: 40rpx; |
| 456 | height: 44rpx; | 476 | height: 44rpx; |
| 457 | } | 477 | } |
| 458 | } | 478 | } |
| 459 | image { | 479 | image { |
| 460 | height: 16px; | 480 | height: 16px; |
| 461 | width: 8px; | 481 | width: 8px; |
| 462 | } | 482 | } |
| 463 | } | 483 | } |
| 464 | .myOrder { | 484 | .myOrder { |
| 465 | width: 100%; | 485 | width: 100%; |
| 466 | height: 296rpx; | 486 | height: 296rpx; |
| 467 | // margin-top: 116rpx; | 487 | // margin-top: 116rpx; |
| 468 | margin-bottom: 20rpx; | 488 | margin-bottom: 20rpx; |
| 469 | padding: 0 40rpx; | 489 | padding: 0 40rpx; |
| 470 | box-sizing: border-box; | 490 | box-sizing: border-box; |
| 471 | background: #ffffff; | 491 | background: #ffffff; |
| 472 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); | 492 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); |
| 473 | border-radius: 6px; | 493 | border-radius: 6px; |
| 474 | border-radius: 6px; | 494 | border-radius: 6px; |
| 475 | display: flex; | 495 | display: flex; |
| 476 | flex-direction: column; | 496 | flex-direction: column; |
| 477 | justify-content: space-around; | 497 | justify-content: space-around; |
| 478 | align-items: center; | 498 | align-items: center; |
| 479 | .orderHeader { | 499 | .orderHeader { |
| 480 | width: 100%; | 500 | width: 100%; |
| 481 | height: 100rpx; | 501 | height: 100rpx; |
| 482 | display: flex; | 502 | display: flex; |
| 483 | flex-direction: row; | 503 | flex-direction: row; |
| 484 | justify-content: space-between; | 504 | justify-content: space-between; |
| 485 | align-items: center; | 505 | align-items: center; |
| 486 | border-bottom: 1px solid #f5f5f5; | 506 | border-bottom: 1px solid #f5f5f5; |
| 487 | font-weight: bold; | 507 | font-weight: bold; |
| 488 | font-size: 18px; | 508 | font-size: 18px; |
| 489 | color: #333333; | 509 | color: #333333; |
| 490 | .btn { | 510 | .btn { |
| 491 | font-size: 12px; | 511 | font-size: 12px; |
| 492 | color: #999999; | 512 | color: #999999; |
| 493 | display: flex; | 513 | display: flex; |
| 494 | align-items: center; | 514 | align-items: center; |
| 495 | image { | 515 | image { |
| 496 | margin-left: 20rpx; | 516 | margin-left: 20rpx; |
| 497 | height: 32rpx; | 517 | height: 32rpx; |
| 498 | width: 16rpx; | 518 | width: 16rpx; |
| 499 | } | 519 | } |
| 500 | } | 520 | } |
| 501 | } | 521 | } |
| 502 | .orderBody { | 522 | .orderBody { |
| 503 | width: 100%; | 523 | width: 100%; |
| 504 | display: flex; | 524 | display: flex; |
| 505 | flex-direction: row; | 525 | flex-direction: row; |
| 506 | justify-content: space-around; | 526 | justify-content: space-around; |
| 507 | align-items: center; | 527 | align-items: center; |
| 508 | .item { | 528 | .item { |
| 509 | display: flex; | 529 | display: flex; |
| 510 | flex-direction: column; | 530 | flex-direction: column; |
| 511 | align-items: center; | 531 | align-items: center; |
| 512 | image { | 532 | image { |
| 513 | width: 62rpx; | 533 | width: 62rpx; |
| 514 | height: 46rpx; | 534 | height: 46rpx; |
| 515 | } | 535 | } |
| 516 | text { | 536 | text { |
| 517 | margin-top: 24rpx; | 537 | margin-top: 24rpx; |
| 518 | font-size: 12px; | 538 | font-size: 12px; |
| 519 | color: #333333; | 539 | color: #333333; |
| 520 | } | 540 | } |
| 521 | } | 541 | } |
| 522 | } | 542 | } |
| 523 | } | 543 | } |
| 524 | .someItem { | 544 | .someItem { |
| 525 | width: 100%; | 545 | width: 100%; |
| 526 | height: 336rpx; | 546 | height: 336rpx; |
| 527 | background: #ffffff; | 547 | background: #ffffff; |
| 528 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); | 548 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); |
| 529 | border-radius: 6px; | 549 | border-radius: 6px; |
| 530 | border-radius: 6px; | 550 | border-radius: 6px; |
| 531 | margin-bottom: 18rpx; | 551 | margin-bottom: 18rpx; |
| 532 | box-sizing: border-box; | 552 | box-sizing: border-box; |
| 533 | padding: 21rpx 48rpx 21rpx 42rpx; | 553 | padding: 21rpx 48rpx 21rpx 42rpx; |
| 534 | box-sizing: border-box; | 554 | box-sizing: border-box; |
| 535 | display: flex; | 555 | display: flex; |
| 536 | flex-direction: column; | 556 | flex-direction: column; |
| 537 | justify-content: space-between; | 557 | justify-content: space-between; |
| 538 | align-items: center; | 558 | align-items: center; |
| 539 | .item { | 559 | .item { |
| 540 | display: grid; | 560 | display: grid; |
| 541 | grid-template-columns: 10% 90%; | 561 | grid-template-columns: 10% 90%; |
| 542 | align-items: center; | 562 | align-items: center; |
| 543 | height: 72rpx; | 563 | height: 72rpx; |
| 544 | width: 100%; | 564 | width: 100%; |
| 545 | .left { | 565 | .left { |
| 546 | font-size: 14px; | 566 | font-size: 14px; |
| 547 | color: #333333; | 567 | color: #333333; |
| 548 | display: flex; | 568 | display: flex; |
| 549 | align-items: center; | 569 | align-items: center; |
| 550 | justify-content: space-between; | 570 | justify-content: space-between; |
| 551 | height: 72rpx; | 571 | height: 72rpx; |
| 552 | border-bottom: 1px solid #f2f2f2; | 572 | border-bottom: 1px solid #f2f2f2; |
| 553 | image { | 573 | image { |
| 554 | margin-right: 0; | 574 | margin-right: 0; |
| 555 | height: 16px; | 575 | height: 16px; |
| 556 | width: 8px; | 576 | width: 8px; |
| 557 | } | 577 | } |
| 558 | } | 578 | } |
| 559 | image { | 579 | image { |
| 560 | margin-right: 32rpx; | 580 | margin-right: 32rpx; |
| 561 | width: 40rpx; | 581 | width: 40rpx; |
| 562 | height: 44rpx; | 582 | height: 44rpx; |
| 563 | } | 583 | } |
| 564 | .lastLeft { | ||
| 565 | border-bottom: none; | ||
| 566 | } | ||
| 567 | } | 584 | } |
| 568 | } | 585 | } |
| 569 | .recommend { | 586 | .recommend { |
| 570 | background: #ffffff; | 587 | background: #ffffff; |
| 571 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); | 588 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); |
| 572 | border-radius: 6px; | 589 | border-radius: 6px; |
| 573 | border-radius: 6px; | 590 | border-radius: 6px; |
| 574 | width: 100%; | 591 | width: 100%; |
| 575 | .title { | 592 | .title { |
| 576 | display: flex; | 593 | display: flex; |
| 577 | flex-direction: row; | 594 | flex-direction: row; |
| 578 | align-items: center; | 595 | align-items: center; |
| 579 | justify-content: space-between; | 596 | justify-content: space-between; |
| 580 | padding: 20rpx 40rpx; | 597 | padding: 20rpx 40rpx; |
| 581 | .line { | 598 | .line { |
| 582 | width: 264rpx; | 599 | width: 264rpx; |
| 583 | height: 1rpx; | 600 | height: 1rpx; |
| 584 | border-bottom: 1px solid #eaeaea; | 601 | border-bottom: 1px solid #eaeaea; |
| 585 | } | 602 | } |
| 586 | .text { | 603 | .text { |
| 587 | font-family: PingFangSC-Medium; | 604 | font-family: PingFangSC-Medium; |
| 588 | font-size: 14px; | 605 | font-size: 14px; |
| 589 | color: #333333; | 606 | color: #333333; |
| 590 | letter-spacing: -0.26px; | 607 | letter-spacing: -0.26px; |
| 591 | text-align: justify; | 608 | text-align: justify; |
| 592 | line-height: 24px; | 609 | line-height: 24px; |
| 593 | } | 610 | } |
| 594 | } | 611 | } |
| 595 | .goods-list { | 612 | .goods-list { |
| 596 | .loading-text { | 613 | .loading-text { |
| 597 | width: 100%; | 614 | width: 100%; |
| 598 | display: flex; | 615 | display: flex; |
| 599 | justify-content: center; | 616 | justify-content: center; |
| 600 | align-items: center; | 617 | align-items: center; |
| 601 | height: 30px; | 618 | height: 30px; |
| 602 | color: #979797; | 619 | color: #979797; |
| 603 | font-size: 12px; | 620 | font-size: 12px; |
| 604 | } | 621 | } |
| 605 | .product-list { | 622 | .product-list { |
| 606 | width: 92%; | 623 | width: 92%; |
| 607 | padding: 0 4% 3vw 4%; | 624 | padding: 0 4% 3vw 4%; |
| 608 | display: flex; | 625 | display: flex; |
| 609 | justify-content: space-between; | 626 | justify-content: space-between; |
| 610 | flex-wrap: wrap; | 627 | flex-wrap: wrap; |
| 611 | .product { | 628 | .product { |
| 612 | width: 48%; | 629 | width: 48%; |
| 613 | margin: 0 0 20rpx 0; | 630 | margin: 0 0 20rpx 0; |
| 614 | background: #ffffff; | 631 | background: #ffffff; |
| 615 | border: 1px solid #f2f2f2; | 632 | border: 1px solid #f2f2f2; |
| 616 | } | 633 | } |
| 617 | } | 634 | } |
| 618 | } | 635 | } |
| 619 | } | 636 | } |
| 620 | .auth { | 637 | .auth { |
| 621 | height: 100vh; | 638 | height: 100vh; |
| 622 | display: flex; | 639 | display: flex; |
| 623 | flex-direction: column; | 640 | flex-direction: column; |
| 624 | align-items: center; | 641 | align-items: center; |
| 625 | .icon { | 642 | .icon { |
| 626 | width: 140rpx; | 643 | width: 140rpx; |
| 627 | height: 140rpx; | 644 | height: 140rpx; |
| 628 | border-radius: 50%; | 645 | border-radius: 50%; |
| 629 | margin-top: 100rpx; | 646 | margin-top: 100rpx; |
| 630 | background-color: grey; | 647 | background-color: grey; |
| 631 | } | 648 | } |
| 632 | .divider { | 649 | .divider { |
| 633 | height: 1rpx; | 650 | height: 1rpx; |
| 634 | width: 600rpx; | 651 | width: 600rpx; |
| 635 | margin-top: 80rpx; | 652 | margin-top: 80rpx; |
| 636 | background-color: #e6e3e3; | 653 | background-color: #e6e3e3; |
| 637 | } | 654 | } |
| 638 | .title { | 655 | .title { |
| 639 | width: 600rpx; | 656 | width: 600rpx; |
| 640 | margin-top: 50rpx; | 657 | margin-top: 50rpx; |
| 641 | text-align: left; | 658 | text-align: left; |
| 642 | } | 659 | } |
| 643 | .text { | 660 | .text { |
| 644 | width: 600rpx; | 661 | width: 600rpx; |
| 645 | margin-top: 30rpx; | 662 | margin-top: 30rpx; |
| 646 | text-align: left; | 663 | text-align: left; |
| 647 | color: #e6e3e3; | 664 | color: #e6e3e3; |
| 648 | } | 665 | } |
| 649 | button { | 666 | button { |
| 650 | width: 450rpx; | 667 | width: 450rpx; |
| 651 | height: 80rpx; | 668 | height: 80rpx; |
| 652 | line-height: 80rpx; | 669 | line-height: 80rpx; |
| 653 | margin-top: 80rpx; | 670 | margin-top: 80rpx; |
| 654 | border-radius: 30rpx; | 671 | border-radius: 30rpx; |
| 655 | } | 672 | } |
| 656 | } | 673 | } |
| 657 | .closeBtn { | 674 | .closeBtn { |
| 658 | height: 28rpx; | 675 | height: 28rpx; |
| 659 | width: 28rpx; | 676 | width: 28rpx; |
| 660 | // border: 1px solid red; | 677 | // border: 1px solid red; |
| 661 | position: absolute; | 678 | position: absolute; |
| 662 | top: 20rpx; | 679 | top: 20rpx; |
| 663 | right: 10rpx; | 680 | right: 10rpx; |
src/store/modules/orderRead.js
| 1 | import urlAlias from '../url' | 1 | import urlAlias from '../url' |
| 2 | import request from '../request' | 2 | import request from '../request' |
| 3 | 3 | ||
| 4 | const { | 4 | const { |
| 5 | orderRead | 5 | orderRead, |
| 6 | detailStandardList, | ||
| 6 | } = urlAlias | 7 | } = urlAlias |
| 7 | 8 | ||
| 8 | const state = { | 9 | const state = { |
| 9 | orderInfo: {} | 10 | orderInfo: {}, |
| 11 | skuList: [], | ||
| 10 | } | 12 | } |
| 11 | 13 | ||
| 12 | const mutations = { | 14 | const mutations = { |
| 13 | INIT: (state, orderInfo) => { | 15 | INIT: (state, orderInfo) => { |
| 14 | state.orderInfo = orderInfo | 16 | state.orderInfo = orderInfo |
| 15 | } | 17 | }, |
| 18 | SKU: (state, skuList) => { | ||
| 19 | state.skuList = skuList | ||
| 20 | }, | ||
| 16 | } | 21 | } |
| 17 | 22 | ||
| 18 | const actions = { | 23 | const actions = { |
| 19 | getOrderInfo({ commit }, param) { | 24 | getOrderInfo({ commit }, param) { |
| 20 | return new Promise ((resolve) => request({ | 25 | return new Promise((resolve) => request({ |
| 21 | url: orderRead, | 26 | url: orderRead, |
| 22 | data: param, | 27 | data: param, |
| 23 | success: (res) => { | 28 | success: (res) => { |
| 24 | console.log(res) | 29 | console.log(res) |
| 25 | commit("INIT", res.data.data) | 30 | commit('INIT', res.data.data) |
| 26 | resolve(res.data.data) | 31 | resolve(res.data.data) |
| 27 | } | 32 | }, |
| 28 | })) | 33 | })) |
| 29 | } | 34 | }, |
| 35 | goodDetails({ commit, rootState }, param) { | ||
| 36 | return new Promise((resolve) => request({ | ||
| 37 | url: detailStandardList, | ||
| 38 | data: param, | ||
| 39 | success: ({ data }) => { | ||
| 40 | const { data: { skuList: list } } = data | ||
| 41 | const { skId } = param | ||
| 42 | const { skuList } = rootState.orderRead | ||
| 43 | console.log('data', list, skId) | ||
| 44 | for (let index = 0; index < list.length; index++) { | ||
| 45 | const element = list[index] | ||
| 46 | if (skId === element.sk_id) { | ||
| 47 | skuList.push(element) | ||
| 48 | } | ||
| 49 | } | ||
| 50 | commit('SKU', skuList) | ||
| 51 | resolve() | ||
| 52 | }, | ||
| 53 | })) | ||
| 54 | }, | ||
| 30 | } | 55 | } |
| 31 | 56 | ||
| 32 | export default { | 57 | export default { |
| 33 | namespaced: true, | 58 | namespaced: true, |
| 34 | state, | 59 | state, |
| 35 | mutations, | 60 | mutations, |
| 36 | actions | 61 | actions, |
| 37 | } | 62 | } |
| 38 | 63 |