Commit 37ccd9675758a32b96d0c9a759a0e9385733e144
1 parent
54d61dc1c4
Exists in
master
订单详情页获取数据
Showing
4 changed files
with
25 additions
and
24 deletions
Show diff stats
src/pages/myOrderPaying/myOrderPaying.vue
| 1 | <!-- 订单待付款 待收货 --> | 1 | <!-- 订单待付款 待收货 --> |
| 2 | <template> | 2 | <template> |
| 3 | <view class="content"> | 3 | <view class="content"> |
| 4 | <!-- 待付款 --> | 4 | <!-- 待付款 --> |
| 5 | <view | 5 | <view |
| 6 | class="order-time" | 6 | class="order-time" |
| 7 | v-if="status == '0'" | 7 | v-if="status == '0'" |
| 8 | > | 8 | > |
| 9 | <text>请在</text> | 9 | <text>请在</text> |
| 10 | <uni-countdown | 10 | <uni-countdown |
| 11 | color="#EC5D3B" | 11 | color="#EC5D3B" |
| 12 | splitor-color="#EC5D3B" | 12 | splitor-color="#EC5D3B" |
| 13 | :show-day="false" | 13 | :show-day="false" |
| 14 | :hour="0" | 14 | :hour="0" |
| 15 | :second="getTime" | 15 | :second="getTime" |
| 16 | @timeup=timeup | 16 | @timeup=timeup |
| 17 | ></uni-countdown> | 17 | ></uni-countdown> |
| 18 | <text>内完成付款</text> | 18 | <text>内完成付款</text> |
| 19 | </view> | 19 | </view> |
| 20 | <!-- 待收货 --> | 20 | <!-- 待收货 --> |
| 21 | <view | 21 | <view |
| 22 | class="headerBanner" | 22 | class="headerBanner" |
| 23 | v-if="status == '1'" | 23 | v-if="status == '1'" |
| 24 | > | 24 | > |
| 25 | <view class="bannerLeft"> | 25 | <view class="bannerLeft"> |
| 26 | <view class="T1">卖家已发货</view> | 26 | <view class="T1">卖家已发货</view> |
| 27 | <view class="T2">还剩 确认收货</view> | 27 | <view class="T2">还剩 确认收货</view> |
| 28 | </view> | 28 | </view> |
| 29 | <image | 29 | <image |
| 30 | src="../../static/car.png" | 30 | src="../../static/car.png" |
| 31 | mode="aspectFill" | 31 | mode="aspectFill" |
| 32 | ></image> | 32 | ></image> |
| 33 | </view> | 33 | </view> |
| 34 | <view class="order"> | 34 | <view class="order"> |
| 35 | <view class="order-user"> | 35 | <view class="order-user"> |
| 36 | <view class="order-user-head"> | 36 | <view class="order-user-head"> |
| 37 | <text class="p1">{{orderAddressInfo.userName}}</text> | 37 | <text class="p1">{{orderAddressInfo.userName}}</text> |
| 38 | <text class="p2">{{orderAddressInfo.telNumber}}</text> | 38 | <text class="p2">{{orderAddressInfo.telNumber}}</text> |
| 39 | </view> | 39 | </view> |
| 40 | <view class="order-user-body"> | 40 | <view class="order-user-body"> |
| 41 | <image src="../../static/myorder-paying-location.png"></image> | 41 | <image src="../../static/myorder-paying-location.png"></image> |
| 42 | <text class="p3">{{orderAddressInfo.provinceName}} {{orderAddressInfo.cityName}} {{orderAddressInfo.countyName}}\n{{orderAddressInfo.detailInfo}}</text> | 42 | <text class="p3">{{orderAddressInfo.provinceName}} {{orderAddressInfo.cityName}} {{orderAddressInfo.countyName}}\n{{orderAddressInfo.detailInfo}}</text> |
| 43 | </view> | 43 | </view> |
| 44 | </view> | 44 | </view> |
| 45 | <view class="order-info"> | 45 | <view class="order-info"> |
| 46 | <view | 46 | <view |
| 47 | class="order-info-head" | 47 | class="order-info-head" |
| 48 | v-for="(orderInfoListItem,index) in orderInfoList" | 48 | v-for="(orderInfoListItem,index) in orderInfoList" |
| 49 | :key="index" | 49 | :key="index" |
| 50 | > | 50 | > |
| 51 | <image | 51 | <image |
| 52 | :src="orderInfoListItem.imgUrl" | 52 | :src="orderInfoListItem.imgUrl" |
| 53 | mode="aspectFill" | 53 | mode="aspectFill" |
| 54 | ></image> | 54 | ></image> |
| 55 | <view class="order-info-head-r"> | 55 | <view class="order-info-head-r"> |
| 56 | <text class="p1">{{orderInfoListItem.p_name}}</text> | 56 | <text class="p1">{{orderInfoListItem.p_name}}</text> |
| 57 | <view | 57 | <view |
| 58 | class="p2" | 58 | class="p2" |
| 59 | style="margin: 0;" | 59 | style="margin: 0;" |
| 60 | > | 60 | > |
| 61 | 规格:玫瑰金 / 钛合金 / 防日光防紫外线 / 超薄超轻 | 61 | 规格:玫瑰金 / 钛合金 / 防日光防紫外线 / 超薄超轻 |
| 62 | <!-- <view class="arrow"></view> --> | 62 | <!-- <view class="arrow"></view> --> |
| 63 | </view> | 63 | </view> |
| 64 | <view class="infoText-bottom"> | 64 | <view class="infoText-bottom"> |
| 65 | <view class="markPrice">{{orderInfoListItem.nowPrice}}</view> | 65 | <view class="markPrice">{{orderInfoListItem.nowPrice}}</view> |
| 66 | <view class="buy-num">X {{orderInfoListItem.num}}</view> | 66 | <view class="buy-num">X {{orderInfoListItem.num}}</view> |
| 67 | </view> | 67 | </view> |
| 68 | </view> | 68 | </view> |
| 69 | </view> | 69 | </view> |
| 70 | <!-- <view class="order-info-goodsnum"> | 70 | <!-- <view class="order-info-goodsnum"> |
| 71 | <text>X1</text> | 71 | <text>X1</text> |
| 72 | </view> --> | 72 | </view> --> |
| 73 | <text class="order-info-freight"> | 73 | <text class="order-info-freight"> |
| 74 | <text class="p1">运费</text> | 74 | <text class="p1">运费</text> |
| 75 | <text class="p2">{{orderInfo.trans_price}}</text> | 75 | <text class="p2">{{orderInfo.trans_price}}</text> |
| 76 | </text> | 76 | </text> |
| 77 | <text class="order-info-discount"> | 77 | <text class="order-info-discount"> |
| 78 | <text class="p1">优惠</text> | 78 | <text class="p1">优惠</text> |
| 79 | <text class="p2">-¥{{totalDiscount}}</text> | 79 | <text class="p2">-¥{{totalDiscount}}</text> |
| 80 | </text> | 80 | </text> |
| 81 | <text class="order-info-price"> | 81 | <text class="order-info-price"> |
| 82 | <text class="p1">实付</text> | 82 | <text class="p1">实付</text> |
| 83 | <text class="p2">¥{{orderInfo.order_info.total_fee}}</text> | 83 | <text class="p2">¥{{orderInfo.order_info[0].total_fee}}</text> |
| 84 | </text> | 84 | </text> |
| 85 | <text class="order-info-num"> | 85 | <text class="order-info-num"> |
| 86 | <text>订单号:{{orderInfo.prepay_id}}</text> | 86 | <text>订单号:{{payId}}</text> |
| 87 | </text> | 87 | </text> |
| 88 | <text class="order-info-time"> | 88 | <text class="order-info-time"> |
| 89 | <text>下单时间:{{orderInfo.pay_time}}</text> | 89 | <text>下单时间:{{orderInfo.order_info[0].pay_time}}</text> |
| 90 | </text> | 90 | </text> |
| 91 | <view class="order-info-hr"></view> | 91 | <view class="order-info-hr"></view> |
| 92 | <view class="order-info-contact"> | 92 | <view class="order-info-contact"> |
| 93 | <image src="../../static/myorder-paying-contact.png"></image> | 93 | <image src="../../static/myorder-paying-contact.png"></image> |
| 94 | <text>联系客服</text> | 94 | <text>联系客服</text> |
| 95 | </view> | 95 | </view> |
| 96 | </view> | 96 | </view> |
| 97 | </view> | 97 | </view> |
| 98 | <view | 98 | <view |
| 99 | class="order-confim" | 99 | class="order-confim" |
| 100 | v-if="status == '0'" | 100 | v-if="status == '0'" |
| 101 | > | 101 | > |
| 102 | <button | 102 | <button |
| 103 | class="b1" | 103 | class="b1" |
| 104 | @click="cancleOrder" | 104 | @click="cancleOrder" |
| 105 | >取消订单</button> | 105 | >取消订单</button> |
| 106 | <button | 106 | <button |
| 107 | class="b2" | 107 | class="b2" |
| 108 | @click="paylog" | 108 | @click="paylog" |
| 109 | >立即支付</button> | 109 | >立即支付</button> |
| 110 | </view> | 110 | </view> |
| 111 | 111 | ||
| 112 | <view | 112 | <view |
| 113 | class="order-confim" | 113 | class="order-confim" |
| 114 | v-if="status == '1'" | 114 | v-if="status == '1'" |
| 115 | > | 115 | > |
| 116 | <!-- <button class="b1">取消订单</button> --> | 116 | <!-- <button class="b1">取消订单</button> --> |
| 117 | <button | 117 | <button |
| 118 | class="b2" | 118 | class="b2" |
| 119 | @click="confirmOrder" | 119 | @click="confirmOrder" |
| 120 | >确认收货</button> | 120 | >确认收货</button> |
| 121 | </view> | 121 | </view> |
| 122 | </view> | 122 | </view> |
| 123 | </template> | 123 | </template> |
| 124 | 124 | ||
| 125 | <script> | 125 | <script> |
| 126 | import store from '@/store' | 126 | import store from '@/store' |
| 127 | import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' | 127 | import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' |
| 128 | export default { | 128 | export default { |
| 129 | components: { | 129 | components: { |
| 130 | UniCountdown | 130 | UniCountdown |
| 131 | }, | 131 | }, |
| 132 | data () { | 132 | data () { |
| 133 | return { | 133 | return { |
| 134 | // orderInfo:{}, | 134 | // orderInfo:{}, |
| 135 | payId: '', | 135 | payId: '', |
| 136 | status: '', | 136 | status: '', |
| 137 | uid: '', | 137 | uid: '', |
| 138 | openid: '', | 138 | openid: '', |
| 139 | lefttime: 0 | 139 | lefttime: 0 |
| 140 | 140 | ||
| 141 | } | 141 | } |
| 142 | }, | 142 | }, |
| 143 | onLoad: function (option) { | 143 | onLoad: function (option) { |
| 144 | console.log(option) | 144 | console.log(option) |
| 145 | this.payId = option.payId | 145 | this.payId = option.payId |
| 146 | this.status = option.status | 146 | this.status = option.status |
| 147 | const openid = uni.getStorageSync('openid') | 147 | const openid = uni.getStorageSync('openid') |
| 148 | const uid = this.$store.state.user.uid | 148 | const uid = this.$store.state.user.uid |
| 149 | this.uid = uid | 149 | this.uid = uid |
| 150 | this.openid = openid | 150 | this.openid = openid |
| 151 | store.dispatch('orderRead/getOrderInfo', { | 151 | store.dispatch('orderRead/getOrderInfo', { |
| 152 | pay_id: this.payId, | 152 | pay_id: this.payId, |
| 153 | uid: '1', | 153 | uid: '1', |
| 154 | openid: openid | 154 | openid: openid |
| 155 | }) | 155 | }) |
| 156 | 156 | ||
| 157 | // this.orderInfo = this.$store.state.orderRead.orderInfo | 157 | // this.orderInfo = this.$store.state.orderRead.orderInfo |
| 158 | }, | 158 | }, |
| 159 | computed: { | 159 | computed: { |
| 160 | // 获取订单详细信息 | 160 | // 获取订单详细信息 |
| 161 | orderInfo () { | 161 | orderInfo () { |
| 162 | console.log(this.$store.state.orderRead.orderInfo) | 162 | console.log(this.$store.state.orderRead.orderInfo) |
| 163 | return this.$store.state.orderRead.orderInfo || {} | 163 | return this.$store.state.orderRead.orderInfo || {} |
| 164 | }, | 164 | }, |
| 165 | orderInfoList () { | 165 | orderInfoList () { |
| 166 | const orderInfoList = this.orderInfo.order_info[0].list | 166 | const orderInfoList = this.orderInfo.order_info[0].list |
| 167 | // console.log(this.orderInfo.order_info[0].list.p_name + 'sssss') | ||
| 167 | return orderInfoList | 168 | return orderInfoList |
| 168 | }, | 169 | }, |
| 169 | // 获取订单地址信息 | 170 | // 获取订单地址信息 |
| 170 | orderAddressInfo () { | 171 | orderAddressInfo () { |
| 171 | return this.orderInfo.order_info[0].address | 172 | return this.orderInfo.order_info[0].address |
| 172 | }, | 173 | }, |
| 173 | // 订单付款时间 | 174 | // 订单付款时间 |
| 174 | getTime () { | 175 | getTime () { |
| 175 | return this.orderInfo.order_info[0].lefttime | 176 | return this.orderInfo.order_info[0].lefttime |
| 176 | }, | 177 | }, |
| 177 | // 计算总优惠额 | 178 | // 计算总优惠额 |
| 178 | totalDiscount () { | 179 | totalDiscount () { |
| 179 | const discountInfoList = this.orderInfo.discount_info | 180 | const discountInfoList = this.orderInfo.discount_info |
| 180 | let totalDiscount = 0 | 181 | let totalDiscount = 0 |
| 181 | if (discountInfoList) { | 182 | if (discountInfoList) { |
| 182 | discountInfoList.map((discountItem, index) => { | 183 | discountInfoList.map((discountItem, index) => { |
| 183 | totalDiscount += Number(discountItem.value) | 184 | totalDiscount += Number(discountItem.value) |
| 184 | }) | 185 | }) |
| 185 | } | 186 | } |
| 186 | // console.log(totalDiscount) | 187 | // console.log(totalDiscount) |
| 187 | return totalDiscount | 188 | return totalDiscount |
| 188 | } | 189 | } |
| 189 | }, | 190 | }, |
| 190 | methods: { | 191 | methods: { |
| 191 | // 取消订单 | 192 | // 取消订单 |
| 192 | timeup () { | 193 | timeup () { |
| 193 | this.cancleOrder() | 194 | this.cancleOrder() |
| 194 | }, | 195 | }, |
| 195 | cancleOrder () { | 196 | cancleOrder () { |
| 196 | const uid = this.uid | 197 | const uid = this.uid |
| 197 | const openid = this.openid | 198 | const openid = this.openid |
| 198 | uni.showModal({ | 199 | uni.showModal({ |
| 199 | title: '提示', | 200 | title: '提示', |
| 200 | content: '现在取消,订单不可恢复哦,确认取消吗?', | 201 | content: '现在取消,订单不可恢复哦,确认取消吗?', |
| 201 | success: function (res) { | 202 | success: function (res) { |
| 202 | if (res.confirm) { | 203 | if (res.confirm) { |
| 203 | store.dispatch('cancelOrder/cancel', { | 204 | store.dispatch('cancelOrder/cancel', { |
| 204 | keyname: '1', | 205 | keyname: '1', |
| 205 | uid: uid, | 206 | uid: uid, |
| 206 | openid: openid | 207 | openid: openid |
| 207 | }) | 208 | }) |
| 208 | } else if (res.cancel) { | 209 | } else if (res.cancel) { |
| 209 | console.log('用户点击取消') | 210 | console.log('用户点击取消') |
| 210 | } | 211 | } |
| 211 | } | 212 | } |
| 212 | }) | 213 | }) |
| 213 | }, | 214 | }, |
| 214 | paylog () { | 215 | paylog () { |
| 215 | 216 | ||
| 216 | }, | 217 | }, |
| 217 | confirmOrder () { | 218 | confirmOrder () { |
| 218 | store.dispatch('statusConfirm/confirm', { | 219 | store.dispatch('statusConfirm/confirm', { |
| 219 | uid: this.uid, | 220 | uid: this.uid, |
| 220 | openid: this.openid, | 221 | openid: this.openid, |
| 221 | oldway: '1', | 222 | oldway: '1', |
| 222 | way: '2', | 223 | way: '2', |
| 223 | pay_id: this.payId, | 224 | pay_id: this.payId, |
| 224 | judgeContent: '', | 225 | judgeContent: '', |
| 225 | orderInfo: this.orderInfo.order_info | 226 | orderInfo: this.orderInfo.order_info |
| 226 | }).then( | 227 | }).then( |
| 227 | setTimeout(() => { | 228 | setTimeout(() => { |
| 228 | uni.navigateBack() | 229 | uni.navigateBack() |
| 229 | }, 1500) | 230 | }, 1500) |
| 230 | ) | 231 | ) |
| 231 | } | 232 | } |
| 232 | } | 233 | } |
| 233 | } | 234 | } |
| 234 | </script> | 235 | </script> |
| 235 | 236 | ||
| 236 | <style lang="scss" scoped> | 237 | <style lang="scss" scoped> |
| 237 | .content { | 238 | .content { |
| 238 | min-height: 100vh; | 239 | min-height: 100vh; |
| 239 | display: flex; | 240 | display: flex; |
| 240 | flex-direction: column; | 241 | flex-direction: column; |
| 241 | justify-content: flex-start; | 242 | justify-content: flex-start; |
| 242 | align-items: center; | 243 | align-items: center; |
| 243 | background-color: #f2f2f2; | 244 | background-color: #f2f2f2; |
| 244 | } | 245 | } |
| 245 | 246 | ||
| 246 | .order { | 247 | .order { |
| 247 | margin-bottom: 112rpx; | 248 | margin-bottom: 112rpx; |
| 248 | background: #f2f2f2; | 249 | background: #f2f2f2; |
| 249 | margin-top: 140rpx; | 250 | margin-top: 140rpx; |
| 250 | width: 670rpx; | 251 | width: 670rpx; |
| 251 | } | 252 | } |
| 252 | 253 | ||
| 253 | .order-time { | 254 | .order-time { |
| 254 | width: 100%; | 255 | width: 100%; |
| 255 | height: 140rpx; | 256 | height: 140rpx; |
| 256 | background-color: #fff; | 257 | background-color: #fff; |
| 257 | display: flex; | 258 | display: flex; |
| 258 | justify-content: center; | 259 | justify-content: center; |
| 259 | align-items: center; | 260 | align-items: center; |
| 260 | position: fixed; | 261 | position: fixed; |
| 261 | top: 0; | 262 | top: 0; |
| 262 | left: 0; | 263 | left: 0; |
| 263 | text { | 264 | text { |
| 264 | // font-family: PingFangSC-Regular; | 265 | // font-family: PingFangSC-Regular; |
| 265 | // margin-top: 48rpx; | 266 | // margin-top: 48rpx; |
| 266 | font-size: 14px; | 267 | font-size: 14px; |
| 267 | color: #333333; | 268 | color: #333333; |
| 268 | letter-spacing: -0.26px; | 269 | letter-spacing: -0.26px; |
| 269 | } | 270 | } |
| 270 | .p2 { | 271 | .p2 { |
| 271 | // font-family: DINAlternate-Bold; | 272 | // font-family: DINAlternate-Bold; |
| 272 | margin: 42rpx 20rpx 0 20rpx; | 273 | margin: 42rpx 20rpx 0 20rpx; |
| 273 | font-size: 18px; | 274 | font-size: 18px; |
| 274 | color: #ec5d3b; | 275 | color: #ec5d3b; |
| 275 | letter-spacing: -0.34px; | 276 | letter-spacing: -0.34px; |
| 276 | } | 277 | } |
| 277 | } | 278 | } |
| 278 | .headerBanner { | 279 | .headerBanner { |
| 279 | width: 100%; | 280 | width: 100%; |
| 280 | height: 140rpx; | 281 | height: 140rpx; |
| 281 | background: #4a90e2; | 282 | background: #4a90e2; |
| 282 | padding: 26rpx 60rpx 24rpx 60rpx; | 283 | padding: 26rpx 60rpx 24rpx 60rpx; |
| 283 | box-sizing: border-box; | 284 | box-sizing: border-box; |
| 284 | color: #ffffff; | 285 | color: #ffffff; |
| 285 | display: flex; | 286 | display: flex; |
| 286 | justify-content: space-between; | 287 | justify-content: space-between; |
| 287 | align-items: center; | 288 | align-items: center; |
| 288 | position: fixed; | 289 | position: fixed; |
| 289 | top: 0; | 290 | top: 0; |
| 290 | left: 0; | 291 | left: 0; |
| 291 | .bannerLeft { | 292 | .bannerLeft { |
| 292 | font-size: 36rpx; | 293 | font-size: 36rpx; |
| 293 | display: flex; | 294 | display: flex; |
| 294 | flex-direction: column; | 295 | flex-direction: column; |
| 295 | justify-content: center; | 296 | justify-content: center; |
| 296 | align-items: center; | 297 | align-items: center; |
| 297 | .T2 { | 298 | .T2 { |
| 298 | font-size: 24rpx; | 299 | font-size: 24rpx; |
| 299 | } | 300 | } |
| 300 | } | 301 | } |
| 301 | image { | 302 | image { |
| 302 | height: 56rpx; | 303 | height: 56rpx; |
| 303 | width: 72rpx; | 304 | width: 72rpx; |
| 304 | } | 305 | } |
| 305 | } | 306 | } |
| 306 | 307 | ||
| 307 | .order-user { | 308 | .order-user { |
| 308 | height: 228rpx; | 309 | height: 228rpx; |
| 309 | background: #ffffff; | 310 | background: #ffffff; |
| 310 | border-radius: 14rpx; | 311 | border-radius: 14rpx; |
| 311 | margin: 0 auto; | 312 | margin: 0 auto; |
| 312 | margin-top: 20rpx; | 313 | margin-top: 20rpx; |
| 313 | margin-bottom: 20rpx; | 314 | margin-bottom: 20rpx; |
| 314 | .order-user-head { | 315 | .order-user-head { |
| 315 | display: flex; | 316 | display: flex; |
| 316 | height: 108rpx; | 317 | height: 108rpx; |
| 317 | align-items: center; | 318 | align-items: center; |
| 318 | margin-left: 126rpx; | 319 | margin-left: 126rpx; |
| 319 | .p1 { | 320 | .p1 { |
| 320 | // font-family: PingFangSC-Regular; | 321 | // font-family: PingFangSC-Regular; |
| 321 | font-size: 14px; | 322 | font-size: 14px; |
| 322 | color: #333333; | 323 | color: #333333; |
| 323 | letter-spacing: -0.26px; | 324 | letter-spacing: -0.26px; |
| 324 | margin-right: 20rpx; | 325 | margin-right: 20rpx; |
| 325 | } | 326 | } |
| 326 | .p2 { | 327 | .p2 { |
| 327 | // font-family: PingFangSC-Regular; | 328 | // font-family: PingFangSC-Regular; |
| 328 | font-size: 14px; | 329 | font-size: 14px; |
| 329 | color: #999999; | 330 | color: #999999; |
| 330 | letter-spacing: -0.26px; | 331 | letter-spacing: -0.26px; |
| 331 | } | 332 | } |
| 332 | } | 333 | } |
| 333 | .order-user-body { | 334 | .order-user-body { |
| 334 | display: flex; | 335 | display: flex; |
| 335 | width: 100%; | 336 | width: 100%; |
| 336 | image { | 337 | image { |
| 337 | width: 24px; | 338 | width: 24px; |
| 338 | height: 26px; | 339 | height: 26px; |
| 339 | margin: 12rpx 32rpx 0 40rpx; | 340 | margin: 12rpx 32rpx 0 40rpx; |
| 340 | } | 341 | } |
| 341 | .p3 { | 342 | .p3 { |
| 342 | // font-family: PingFangSC-Semibold; | 343 | // font-family: PingFangSC-Semibold; |
| 343 | font-size: 14px; | 344 | font-size: 14px; |
| 344 | color: #333333; | 345 | color: #333333; |
| 345 | letter-spacing: -0.26px; | 346 | letter-spacing: -0.26px; |
| 346 | } | 347 | } |
| 347 | } | 348 | } |
| 348 | } | 349 | } |
| 349 | 350 | ||
| 350 | .order-info { | 351 | .order-info { |
| 351 | background-color: #fff; | 352 | background-color: #fff; |
| 352 | box-shadow: 0 0 20rpx 0 rgba(177, 128, 128, 0.06); | 353 | box-shadow: 0 0 20rpx 0 rgba(177, 128, 128, 0.06); |
| 353 | border-radius: 16rpx; | 354 | border-radius: 16rpx; |
| 354 | margin: 0 auto; | 355 | margin: 0 auto; |
| 355 | view { | 356 | view { |
| 356 | margin-left: 40rpx; | 357 | margin-left: 40rpx; |
| 357 | } | 358 | } |
| 358 | text { | 359 | text { |
| 359 | font-size: 14px; | 360 | font-size: 14px; |
| 360 | } | 361 | } |
| 361 | .order-info-head { | 362 | .order-info-head { |
| 362 | display: flex; | 363 | display: flex; |
| 363 | padding-top: 40rpx; | 364 | padding-top: 40rpx; |
| 364 | image { | 365 | image { |
| 365 | height: 188rpx; | 366 | height: 188rpx; |
| 366 | width: 188rpx; | 367 | width: 188rpx; |
| 367 | } | 368 | } |
| 368 | .order-info-head-r { | 369 | .order-info-head-r { |
| 369 | margin: 0; | 370 | margin: 0; |
| 370 | width: 368rpx; | 371 | width: 368rpx; |
| 371 | margin-left: 24rpx; | 372 | margin-left: 24rpx; |
| 372 | // margin-top: 40rpx; | 373 | // margin-top: 40rpx; |
| 373 | text { | 374 | text { |
| 374 | display: block; | 375 | display: block; |
| 375 | } | 376 | } |
| 376 | // .arrow{ | 377 | // .arrow{ |
| 377 | // width: 0; | 378 | // width: 0; |
| 378 | // height: 0; | 379 | // height: 0; |
| 379 | // border-left: 5px transparent; | 380 | // border-left: 5px transparent; |
| 380 | // border-right: 5px transparent; | 381 | // border-right: 5px transparent; |
| 381 | // border-top: 5px #979797; | 382 | // border-top: 5px #979797; |
| 382 | // border-bottom: 0 transparent; | 383 | // border-bottom: 0 transparent; |
| 383 | // border-style: solid; | 384 | // border-style: solid; |
| 384 | // position: relative; | 385 | // position: relative; |
| 385 | // // transform: scaleY(-1); | 386 | // // transform: scaleY(-1); |
| 386 | // } | 387 | // } |
| 387 | // .arrow::after{ | 388 | // .arrow::after{ |
| 388 | // content: ''; | 389 | // content: ''; |
| 389 | // position: absolute; | 390 | // position: absolute; |
| 390 | // top: -6.5px; | 391 | // top: -6.5px; |
| 391 | // left: -5px; | 392 | // left: -5px; |
| 392 | // border-left: 5px transparent; | 393 | // border-left: 5px transparent; |
| 393 | // border-right: 5px transparent; | 394 | // border-right: 5px transparent; |
| 394 | // border-top: 5px #FFFFFF; | 395 | // border-top: 5px #FFFFFF; |
| 395 | // border-bottom: 0 transparent; | 396 | // border-bottom: 0 transparent; |
| 396 | // border-style: solid; | 397 | // border-style: solid; |
| 397 | // } | 398 | // } |
| 398 | .p1 { | 399 | .p1 { |
| 399 | min-height: 40px; | 400 | min-height: 40px; |
| 400 | // font-family: PingFangSC-Regular; | 401 | // font-family: PingFangSC-Regular; |
| 401 | font-size: 14px; | 402 | font-size: 14px; |
| 402 | color: #333333; | 403 | color: #333333; |
| 403 | letter-spacing: -0.26px; | 404 | letter-spacing: -0.26px; |
| 404 | line-height: 18px; | 405 | line-height: 18px; |
| 405 | // line-height: 20px; | 406 | // line-height: 20px; |
| 406 | } | 407 | } |
| 407 | .p2 { | 408 | .p2 { |
| 408 | height: 34px; | 409 | height: 34px; |
| 409 | padding: 1px 0 3px 0; | 410 | padding: 1px 0 3px 0; |
| 410 | // font-family: PingFangSC-Regular; | 411 | // font-family: PingFangSC-Regular; |
| 411 | font-size: 12px; | 412 | font-size: 12px; |
| 412 | color: #999999; | 413 | color: #999999; |
| 413 | letter-spacing: -0.23px; | 414 | letter-spacing: -0.23px; |
| 414 | } | 415 | } |
| 415 | .infoText-bottom { | 416 | .infoText-bottom { |
| 416 | display: flex; | 417 | display: flex; |
| 417 | flex-direction: row; | 418 | flex-direction: row; |
| 418 | justify-content: flex-start; | 419 | justify-content: flex-start; |
| 419 | align-items: center; | 420 | align-items: center; |
| 420 | width: 100%; | 421 | width: 100%; |
| 421 | margin-left: 0; | 422 | margin-left: 0; |
| 422 | .markPrice { | 423 | .markPrice { |
| 423 | font-size: 14px; | 424 | font-size: 14px; |
| 424 | color: #ff6b4a; | 425 | color: #ff6b4a; |
| 425 | margin-right: 20rpx; | 426 | margin-right: 20rpx; |
| 426 | margin-left: 0rpx; | 427 | margin-left: 0rpx; |
| 427 | } | 428 | } |
| 428 | .buy-num { | 429 | .buy-num { |
| 429 | font-size: 12px; | 430 | font-size: 12px; |
| 430 | color: #999999; | 431 | color: #999999; |
| 431 | } | 432 | } |
| 432 | } | 433 | } |
| 433 | } | 434 | } |
| 434 | } | 435 | } |
| 435 | // .order-info-goodsnum { | 436 | // .order-info-goodsnum { |
| 436 | // display: flex; | 437 | // display: flex; |
| 437 | // align-items: center; | 438 | // align-items: center; |
| 438 | // justify-content: flex-end; | 439 | // justify-content: flex-end; |
| 439 | // text { | 440 | // text { |
| 440 | // margin-right: 44rpx; | 441 | // margin-right: 44rpx; |
| 441 | // // ont-family: PingFangSC-Regular; | 442 | // // ont-family: PingFangSC-Regular; |
| 442 | // font-size: 12px; | 443 | // font-size: 12px; |
| 443 | // color: #999999; | 444 | // color: #999999; |
| 444 | // letter-spacing: -0.23px; | 445 | // letter-spacing: -0.23px; |
| 445 | // } | 446 | // } |
| 446 | // } | 447 | // } |
| 447 | .order-info-freight { | 448 | .order-info-freight { |
| 448 | display: block; | 449 | display: block; |
| 449 | margin-left: 40rpx; | 450 | margin-left: 40rpx; |
| 450 | margin-top: 22rpx; | 451 | margin-top: 22rpx; |
| 451 | .p1 { | 452 | .p1 { |
| 452 | // font-family: PingFangSC-Regular; | 453 | // font-family: PingFangSC-Regular; |
| 453 | font-size: 14px; | 454 | font-size: 14px; |
| 454 | color: #333333; | 455 | color: #333333; |
| 455 | letter-spacing: -0.26px; | 456 | letter-spacing: -0.26px; |
| 456 | line-height: 18px; | 457 | line-height: 18px; |
| 457 | margin-right: 24px; | 458 | margin-right: 24px; |
| 458 | } | 459 | } |
| 459 | .p2 { | 460 | .p2 { |
| 460 | // font-family: PingFangSC-Regular; | 461 | // font-family: PingFangSC-Regular; |
| 461 | font-size: 14px; | 462 | font-size: 14px; |
| 462 | color: #ff6b4a; | 463 | color: #ff6b4a; |
| 463 | letter-spacing: -0.26px; | 464 | letter-spacing: -0.26px; |
| 464 | } | 465 | } |
| 465 | } | 466 | } |
| 466 | .order-info-discount { | 467 | .order-info-discount { |
| 467 | display: block; | 468 | display: block; |
| 468 | margin-left: 40rpx; | 469 | margin-left: 40rpx; |
| 469 | margin-top: 24rpx; | 470 | margin-top: 24rpx; |
| 470 | .p1 { | 471 | .p1 { |
| 471 | // font-family: PingFangSC-Regular; | 472 | // font-family: PingFangSC-Regular; |
| 472 | font-size: 14px; | 473 | font-size: 14px; |
| 473 | color: #333333; | 474 | color: #333333; |
| 474 | letter-spacing: -0.26px; | 475 | letter-spacing: -0.26px; |
| 475 | line-height: 18px; | 476 | line-height: 18px; |
| 476 | margin-right: 24px; | 477 | margin-right: 24px; |
| 477 | } | 478 | } |
| 478 | .p2 { | 479 | .p2 { |
| 479 | // font-family: PingFangSC-Regular; | 480 | // font-family: PingFangSC-Regular; |
| 480 | font-size: 14px; | 481 | font-size: 14px; |
| 481 | color: #ff6b4a; | 482 | color: #ff6b4a; |
| 482 | letter-spacing: -0.26px; | 483 | letter-spacing: -0.26px; |
| 483 | } | 484 | } |
| 484 | } | 485 | } |
| 485 | .order-info-price { | 486 | .order-info-price { |
| 486 | display: block; | 487 | display: block; |
| 487 | margin-left: 40rpx; | 488 | margin-left: 40rpx; |
| 488 | margin-top: 24rpx; | 489 | margin-top: 24rpx; |
| 489 | .p1 { | 490 | .p1 { |
| 490 | // font-family: PingFangSC-Semibold; | 491 | // font-family: PingFangSC-Semibold; |
| 491 | font-size: 14px; | 492 | font-size: 14px; |
| 492 | color: #333333; | 493 | color: #333333; |
| 493 | letter-spacing: -0.26px; | 494 | letter-spacing: -0.26px; |
| 494 | line-height: 18px; | 495 | line-height: 18px; |
| 495 | margin-right: 24px; | 496 | margin-right: 24px; |
| 496 | } | 497 | } |
| 497 | .p2 { | 498 | .p2 { |
| 498 | // font-family: PingFangSC-Semibold; | 499 | // font-family: PingFangSC-Semibold; |
| 499 | font-size: 14px; | 500 | font-size: 14px; |
| 500 | color: #ff6b4a; | 501 | color: #ff6b4a; |
| 501 | letter-spacing: -0.26px; | 502 | letter-spacing: -0.26px; |
| 502 | } | 503 | } |
| 503 | } | 504 | } |
| 504 | .order-info-num { | 505 | .order-info-num { |
| 505 | display: block; | 506 | display: block; |
| 506 | margin-left: 40rpx; | 507 | margin-left: 40rpx; |
| 507 | margin-top: 44rpx; | 508 | margin-top: 44rpx; |
| 508 | text { | 509 | text { |
| 509 | // font-family: PingFangSC-Regular; | 510 | // font-family: PingFangSC-Regular; |
| 510 | font-size: 12px; | 511 | font-size: 12px; |
| 511 | color: #999999; | 512 | color: #999999; |
| 512 | letter-spacing: -0.23px; | 513 | letter-spacing: -0.23px; |
| 513 | } | 514 | } |
| 514 | } | 515 | } |
| 515 | .order-info-time { | 516 | .order-info-time { |
| 516 | display: block; | 517 | display: block; |
| 517 | margin: 8rpx 0 48rpx 40rpx; | 518 | margin: 8rpx 0 48rpx 40rpx; |
| 518 | text { | 519 | text { |
| 519 | // font-family: PingFangSC-Regular; | 520 | // font-family: PingFangSC-Regular; |
| 520 | font-size: 12px; | 521 | font-size: 12px; |
| 521 | color: #999999; | 522 | color: #999999; |
| 522 | letter-spacing: -0.23px; | 523 | letter-spacing: -0.23px; |
| 523 | } | 524 | } |
| 524 | } | 525 | } |
| 525 | .order-info-hr { | 526 | .order-info-hr { |
| 526 | width: 520rpx; | 527 | width: 520rpx; |
| 527 | height: 1px; | 528 | height: 1px; |
| 528 | background-color: #e9e9e9; | 529 | background-color: #e9e9e9; |
| 529 | margin-bottom: 20rpx; | 530 | margin-bottom: 20rpx; |
| 530 | } | 531 | } |
| 531 | .order-info-contact { | 532 | .order-info-contact { |
| 532 | display: flex; | 533 | display: flex; |
| 533 | padding-bottom: 28rpx; | 534 | padding-bottom: 28rpx; |
| 534 | image { | 535 | image { |
| 535 | width: 19px; | 536 | width: 19px; |
| 536 | height: 16px; | 537 | height: 16px; |
| 537 | } | 538 | } |
| 538 | text { | 539 | text { |
| 539 | // font-family: PingFangSC-Regular; | 540 | // font-family: PingFangSC-Regular; |
| 540 | margin-left: 20rpx; | 541 | margin-left: 20rpx; |
| 541 | font-size: 14px; | 542 | font-size: 14px; |
| 542 | color: #333333; | 543 | color: #333333; |
| 543 | letter-spacing: -0.26px; | 544 | letter-spacing: -0.26px; |
| 544 | line-height: 18px; | 545 | line-height: 18px; |
| 545 | } | 546 | } |
| 546 | } | 547 | } |
| 547 | } | 548 | } |
| 548 | 549 | ||
| 549 | .order-confim { | 550 | .order-confim { |
| 550 | display: flex; | 551 | display: flex; |
| 551 | align-items: center; | 552 | align-items: center; |
| 552 | justify-content: flex-end; | 553 | justify-content: flex-end; |
| 553 | // z-index: 999; | 554 | // z-index: 999; |
| 554 | width: 100%; | 555 | width: 100%; |
| 555 | height: 112rpx; | 556 | height: 112rpx; |
| 556 | position: fixed; | 557 | position: fixed; |
| 557 | bottom: 0; | 558 | bottom: 0; |
| 558 | background: #ffffff; | 559 | background: #ffffff; |
| 559 | button { | 560 | button { |
| 560 | width: 204rpx; | 561 | width: 204rpx; |
| 561 | height: 80rpx; | 562 | height: 80rpx; |
| 562 | border: 1px solid #ff6b4a; | 563 | border: 1px solid #ff6b4a; |
| 563 | border-radius: 40rpx; | 564 | border-radius: 40rpx; |
| 564 | font-size: 32rpx; | 565 | font-size: 32rpx; |
| 565 | letter-spacing: -0.3px; | 566 | letter-spacing: -0.3px; |
| 566 | margin-right: 0; | 567 | margin-right: 0; |
| 567 | } | 568 | } |
| 568 | .b1 { | 569 | .b1 { |
| 569 | // font-family: PingFangSC-Regular; | 570 | // font-family: PingFangSC-Regular; |
| 570 | color: #ff6b4a; | 571 | color: #ff6b4a; |
| 571 | background-color: #ffffff; | 572 | background-color: #ffffff; |
| 572 | } | 573 | } |
| 573 | .b2 { | 574 | .b2 { |
| 574 | // font-family: PingFangSC-Regular; | 575 | // font-family: PingFangSC-Regular; |
| 575 | background-color: #ff6b4a; | 576 | background-color: #ff6b4a; |
| 576 | color: #ffffff; | 577 | color: #ffffff; |
| 577 | margin: 0 26rpx 0 20rpx; | 578 | margin: 0 26rpx 0 20rpx; |
| 578 | } | 579 | } |
| 579 | } | 580 | } |
| 580 | </style> | 581 | </style> |
| 581 | 582 |
src/store/modules/detailStandard_k.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 | detailStandardUrl | 5 | detailStandardUrl |
| 6 | } = urlAlias | 6 | } = urlAlias |
| 7 | 7 | ||
| 8 | const state = { | 8 | const state = { |
| 9 | list:[], | 9 | list:[], |
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | const mutations = { | 12 | const mutations = { |
| 13 | INIT: (state, data) => { | 13 | INIT: (state, data) => { |
| 14 | state.list = data; | 14 | state.list = data; |
| 15 | }, | 15 | }, |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| 18 | const actions = { | 18 | const actions = { |
| 19 | fetch({ commit }, param) { | 19 | fetch({ commit }, param) { |
| 20 | request({ | 20 | request({ |
| 21 | url: detailStandardUrl, | 21 | url: detailStandardUrl, |
| 22 | data: param, | 22 | data: param, |
| 23 | success: (res) => { | 23 | success: (res) => { |
| 24 | commit('INIT', res.data); | 24 | commit('INIT', res.data) |
| 25 | }, | 25 | }, |
| 26 | fail: (res) => { | 26 | fail: (res) => { |
| 27 | console.log(" detail fail status === > ", res); | 27 | console.log(" detail fail status === > ", res); |
| 28 | }, | 28 | }, |
| 29 | complete: (res) => { | 29 | complete: (res) => { |
| 30 | console.log(" detail complete status === > ", res); | 30 | console.log(" detail complete status === > ", res); |
| 31 | }, | 31 | }, |
| 32 | }) | 32 | }) |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | export default { | 36 | export default { |
| 37 | namespaced: true, | 37 | namespaced: true, |
| 38 | state, | 38 | state, |
| 39 | mutations, | 39 | mutations, |
| 40 | actions, | 40 | actions, |
| 41 | } | 41 | } |
src/store/modules/myOrder.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 | myOrderList | 5 | myOrderList |
| 6 | } = urlAlias; | 6 | } = urlAlias |
| 7 | 7 | ||
| 8 | // const data = { | 8 | // const data = { |
| 9 | // data: [ | 9 | // data: [ |
| 10 | // { | 10 | // { |
| 11 | // finished_time: null, | 11 | // finished_time: null, |
| 12 | // is_refound: "0", | 12 | // is_refound: "0", |
| 13 | // mch_id: "1436019502", | 13 | // mch_id: "1436019502", |
| 14 | // money_of_dcw: "0", | 14 | // money_of_dcw: "0", |
| 15 | // money_of_partner: "0", | 15 | // money_of_partner: "0", |
| 16 | // money_of_shop: "0", | 16 | // money_of_shop: "0", |
| 17 | // orderJudge: false, | 17 | // orderJudge: false, |
| 18 | // order_info: { | 18 | // order_info: { |
| 19 | // address:{ | 19 | // address:{ |
| 20 | // cityName: "镇江市", | 20 | // cityName: "镇江市", |
| 21 | // countyName: "丹阳市", | 21 | // countyName: "丹阳市", |
| 22 | // detailInfo: "延陵镇柳茹村卫生室附近秀野堂农业发展有限公司", | 22 | // detailInfo: "延陵镇柳茹村卫生室附近秀野堂农业发展有限公司", |
| 23 | // errMsg: "chooseAddress:ok", | 23 | // errMsg: "chooseAddress:ok", |
| 24 | // nationalCode: "321181", | 24 | // nationalCode: "321181", |
| 25 | // postalCode: "212300", | 25 | // postalCode: "212300", |
| 26 | // provinceName: "江苏省", | 26 | // provinceName: "江苏省", |
| 27 | // telNumber: "15896379277", | 27 | // telNumber: "15896379277", |
| 28 | // userName: "点餐汪客服", | 28 | // userName: "点餐汪客服", |
| 29 | // }, | 29 | // }, |
| 30 | // cartinfo:['11', '12'], | 30 | // cartinfo:['11', '12'], |
| 31 | // keyname: "1_1587129366", | 31 | // keyname: "1_1587129366", |
| 32 | // lefttime: 179995, | 32 | // lefttime: 179995, |
| 33 | // list:[ | 33 | // list:[ |
| 34 | // { | 34 | // { |
| 35 | // cart_id: "11", | 35 | // cart_id: "11", |
| 36 | // imgUrl: "https://glass.xiuyetang.com//upload_jk/4/4_0_3FDA03.jpg", | 36 | // imgUrl: "https://glass.xiuyetang.com//upload_jk/4/4_0_3FDA03.jpg", |
| 37 | // img_index_url: null, | 37 | // img_index_url: null, |
| 38 | // memo: "志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流,01-8701", | 38 | // memo: "志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流,01-8701", |
| 39 | // mp_id: "1", | 39 | // mp_id: "1", |
| 40 | // nowPrice: 100, | 40 | // nowPrice: 100, |
| 41 | // num: "2", | 41 | // num: "2", |
| 42 | // oldPrice: "0", | 42 | // oldPrice: "0", |
| 43 | // p_discount: "1", | 43 | // p_discount: "1", |
| 44 | // p_name: "01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流", | 44 | // p_name: "01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流", |
| 45 | // p_root_index: "1", | 45 | // p_root_index: "1", |
| 46 | // p_sale_price: "0", | 46 | // p_sale_price: "0", |
| 47 | // peopleName: "me", | 47 | // peopleName: "me", |
| 48 | // pics: '', | 48 | // pics: '', |
| 49 | // pid: "4", | 49 | // pid: "4", |
| 50 | // sk_id: "38", | 50 | // sk_id: "38", |
| 51 | // }, | 51 | // }, |
| 52 | // ], | 52 | // ], |
| 53 | // orderDesc: "总共包括有:01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流在内的1件商品", | 53 | // orderDesc: "总共包括有:01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流在内的1件商品", |
| 54 | // total_fee: 100 | 54 | // total_fee: 100 |
| 55 | // }, | 55 | // }, |
| 56 | // partner_uid: "0", | 56 | // partner_uid: "0", |
| 57 | // pay_cate: "2020", | 57 | // pay_cate: "2020", |
| 58 | // pay_id: "3", | 58 | // pay_id: "3", |
| 59 | // pay_time: "2020-04-17 21:16:12", | 59 | // pay_time: "2020-04-17 21:16:12", |
| 60 | // pay_wood_desc: "在【非常戴镜】的微信付款凭证", | 60 | // pay_wood_desc: "在【非常戴镜】的微信付款凭证", |
| 61 | // pay_wood_id: "fcdj-1-1_1587129366", | 61 | // pay_wood_id: "fcdj-1-1_1587129366", |
| 62 | // prepay_id: "wx172116124528226bf1a8adad1662456500", | 62 | // prepay_id: "wx172116124528226bf1a8adad1662456500", |
| 63 | // re_check_staus: "0", | 63 | // re_check_staus: "0", |
| 64 | // shopid: "0", | 64 | // shopid: "0", |
| 65 | // split_userid: "0", | 65 | // split_userid: "0", |
| 66 | // status: "1", | 66 | // status: "1", |
| 67 | // total_fee: "100", | 67 | // total_fee: "100", |
| 68 | // uid: "1", | 68 | // uid: "1", |
| 69 | // } | 69 | // } |
| 70 | // ], | 70 | // ], |
| 71 | // msg: "订单列表", | 71 | // msg: "订单列表", |
| 72 | // status: 0, | 72 | // status: 0, |
| 73 | // } | 73 | // } |
| 74 | 74 | ||
| 75 | const state = { | 75 | const state = { |
| 76 | orderList: [], | 76 | orderList: [], |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | const mutations = { | 79 | const mutations = { |
| 80 | INIT: (state, data) => { | 80 | INIT: (state, data) => { |
| 81 | state.orderList = data; | 81 | state.orderList = data; |
| 82 | }, | 82 | }, |
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | const actions = { | 85 | const actions = { |
| 86 | getList({ commit }, param) { | 86 | getList({ commit }, param) { |
| 87 | request({ | 87 | request({ |
| 88 | url: myOrderList, | 88 | url: myOrderList, |
| 89 | data: param, | 89 | data: param, |
| 90 | success: (res) => { | 90 | success: (res) => { |
| 91 | // console.log(res.data); | 91 | // console.log(res.data); |
| 92 | commit("INIT", res.data.data); | 92 | commit("INIT", res.data.data); |
| 93 | }, | 93 | }, |
| 94 | }) | 94 | }) |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | export default { | 98 | export default { |
| 99 | namespaced: true, | 99 | namespaced: true, |
| 100 | state, | 100 | state, |
| 101 | mutations, | 101 | mutations, |
| 102 | actions, | 102 | actions, |
| 103 | } | 103 | } |
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 | } = urlAlias; | 6 | } = urlAlias |
| 7 | 7 | ||
| 8 | const state = { | 8 | const state = { |
| 9 | orderInfo: {}, | 9 | orderInfo: {} |
| 10 | }; | 10 | } |
| 11 | 11 | ||
| 12 | const mutations = { | 12 | const mutations = { |
| 13 | INIT: (state, orderInfo) => { | 13 | INIT: (state, orderInfo) => { |
| 14 | state.orderInfo = orderInfo; | 14 | state.orderInfo = orderInfo |
| 15 | }, | 15 | } |
| 16 | }; | 16 | } |
| 17 | 17 | ||
| 18 | const actions = { | 18 | const actions = { |
| 19 | getOrderInfo({ commit }, param) { | 19 | getOrderInfo({ commit }, param) { |
| 20 | request({ | 20 | request({ |
| 21 | url: orderRead, | 21 | url: orderRead, |
| 22 | data: param, | 22 | data: param, |
| 23 | success: (res) => { | 23 | success: (res) => { |
| 24 | commit("INIT", res.data.data); | 24 | commit("INIT", res.data.data) |
| 25 | }, | 25 | } |
| 26 | }) | 26 | }) |
| 27 | }, | 27 | } |
| 28 | }; | 28 | } |
| 29 | 29 | ||
| 30 | export default { | 30 | export default { |
| 31 | namespaced: true, | 31 | namespaced: true, |
| 32 | state, | 32 | state, |
| 33 | mutations, | 33 | mutations, |
| 34 | actions, | 34 | actions |
| 35 | }; | 35 | } |
| 36 | 36 |