detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view style="padding: 0 20rpx;" :style="vuex_skin">
  3. <image style="width: 100vw;height: 8rpx;" src="@/static/icon/divider.png" mode=""></image>
  4. <view class="title border-bottom" style="padding-top: 30rpx;">
  5. <text>收货人信息</text>
  6. </view>
  7. <view class="data">
  8. <view class="flex">
  9. <view style="color:#a0a0a0;width: 23%;">收货人:</view>
  10. <view class="center">{{detail.consignee}}</view>
  11. <view class="margin-left-50 center">
  12. <text>{{detail.phone}}</text>
  13. </view>
  14. </view>
  15. <view class="flex" style="padding-top: 35rpx;">
  16. <view style="color:#a0a0a0;width: 23%;">收货地址:</view>
  17. <text class="">{{detail.address}}</text>
  18. </view>
  19. </view>
  20. <u-gap height="20" bg-color="#f6f6f6"></u-gap>
  21. <view class="title border-bottom">
  22. <text>商品信息</text>
  23. </view>
  24. <view class="goods border-bottom">
  25. <view class="">
  26. <image :src="detail.goodsImgUrl" mode=""></image>
  27. </view>
  28. <view class="content">
  29. <view class="text-cut-2" style="font-size: 28rpx;">{{detail.goodsName}}</view>
  30. <view style="color: #9e9e9e;">
  31. <text>价格:</text>
  32. <text class="text-price">{{detail.goodsPoint}} 积分</text>
  33. <text class="cuIcon-close margin-left-50" style="font-size: 22rpx;"></text>
  34. <text class="" style="font-size: 24rpx;">{{detail.num}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="price-data">
  39. <view class="">
  40. <text style="color: #959595;">商品总价:</text>
  41. <text class="" style="color: #1e1e1e;">{{$digital.floatMul(detail.goodsPoint,detail.num)}} 积分</text>
  42. </view>
  43. <view class="">
  44. <text style="color: #959595;">使用积分:</text>
  45. <text class="" style="color: #1e1e1e;">{{detail.usePoint}} 积分</text>
  46. </view>
  47. <view class="">
  48. <text style="color: #959595;">使用现金:</text>
  49. <text class="" style="color: #1e1e1e;">{{useCash(detail)}} 元</text>
  50. </view>
  51. </view>
  52. <u-gap height="20" bg-color="#f6f6f6"></u-gap>
  53. <view class="title border-bottom">
  54. <text>订单信息</text>
  55. </view>
  56. <view class="price-data">
  57. <view class="">
  58. <text style="color: #959595;">订单状态:</text>
  59. <text class="" style="color: #1e1e1e;">{{detail.goodsStatus}}</text>
  60. </view>
  61. <view class="">
  62. <text style="color: #959595;">物流编号:</text>
  63. <text class=""
  64. style="color: #1e1e1e;">{{detail.trackingNumber==-1 || $isEmpty(detail.trackingNumber)?'暂无物流':detail.trackingNumber}}</text>
  65. </view>
  66. <view class="">
  67. <text style="color: #959595;">物流公司:</text>
  68. <text class="" style="color: #1e1e1e;">{{detail.trackingName || '暂无物流'}}</text>
  69. </view>
  70. <view class="">
  71. <text style="color: #959595;">订单编号:</text>
  72. <text class="" style="color: #1e1e1e;" @click="$util.copy(detail.id)">{{detail.id}}</text>
  73. </view>
  74. <view class="">
  75. <text style="color: #959595;">创建时间:</text>
  76. <text class="" style="color: #1e1e1e;">{{detail.createTime}}</text>
  77. </view>
  78. </view>
  79. <block>
  80. <view class="" style="height: 250rpx;"></view>
  81. <view class="footer-fixed flex bg-white u-border-top" style="justify-content: flex-end;padding: 25rpx 0;">
  82. <u-button v-if="detail.goodsStatus == '待收货' || detail.goodsStatus == '已完成'" @click="queryLogistic"
  83. :custom-style="customStyle1" shape="circle">查看物流
  84. </u-button>
  85. <u-button open-type="contact" :custom-style="customStyle2" shape="circle">咨询客服</u-button>
  86. <u-button @click="confirmReceipt" v-if="detail.goodsStatus == '待收货'" :custom-style="customStyle3"
  87. shape="circle" size="mini">确认订单</u-button>
  88. <u-button @click="exchange" :custom-style="customStyle3" v-else shape="circle">再次兑换</u-button>
  89. </view>
  90. </block>
  91. <toast ref="toast" ></toast>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. id: '',
  99. detail: {},
  100. customStyle1: {
  101. marginRight: '15rpx',
  102. color: '#353535',
  103. borderColor: '#999999',
  104. height: '60rpx',
  105. width: '180rpx',
  106. fontSize: '24rpx'
  107. },
  108. customStyle2: {
  109. marginRight: '15rpx',
  110. color: '#353535',
  111. borderColor: '#999999',
  112. height: '60rpx',
  113. width: '180rpx',
  114. fontSize: '24rpx'
  115. },
  116. customStyle3: {
  117. backgroundColor: "#E72226",
  118. color: '#fff',
  119. height: '60rpx',
  120. width: '180rpx',
  121. fontSize: '24rpx',
  122. marginRight: '15rpx',
  123. }
  124. }
  125. },
  126. computed: {
  127. useCash() {
  128. return data => {
  129. if (data.cash == -1 || this.$isEmpty(data.cash)) {
  130. return 0
  131. }
  132. return data.cash
  133. }
  134. }
  135. },
  136. onLoad(options) {
  137. this.id = options.id
  138. this.fetchDetail()
  139. },
  140. methods: {
  141. exchange() {
  142. uni.switchTab({
  143. url: "/pages/shop/shop"
  144. })
  145. },
  146. fetchDetail() {
  147. let params = {
  148. id: this.id
  149. }
  150. this.$api.goodsorder.detail(params).then(res => {
  151. this.detail = res.data.data
  152. })
  153. },
  154. queryLogistic() {
  155. uni.navigateTo({
  156. url: "/pages/mine/logistics/logistics?id=" + this.id,
  157. fail(err) {
  158. console.log(err);
  159. }
  160. })
  161. },
  162. confirmReceipt() {
  163. this.$dialog.showModal('确定收货?', true, this.vuex_theme.bgColor).then(res => {
  164. let params = {
  165. id:this.id,
  166. goodsStatus: '已完成'
  167. }
  168. this.$api.goodsorder.submit(params).then(res => {
  169. if (res.data.success) {
  170. this.$refs.toast.info('操作成功')
  171. this.fetchDetail()
  172. }
  173. })
  174. })
  175. },
  176. }
  177. }
  178. </script>
  179. <style>
  180. page {
  181. background-color: #FFFFFF;
  182. }
  183. </style>
  184. <style lang="scss">
  185. .border-bottom {
  186. border-bottom: 1rpx solid #e2e2e2;
  187. }
  188. .title {
  189. padding: 35rpx 20rpx;
  190. font-size: 30rpx;
  191. color: #000;
  192. }
  193. .data {
  194. padding: 35rpx 20rpx;
  195. }
  196. .goods {
  197. display: flex;
  198. padding: 25rpx 20rpx;
  199. width: 100%;
  200. image {
  201. width: 150rpx;
  202. height: 150rpx;
  203. border-radius: 12rpx;
  204. }
  205. .content {
  206. line-height: 42rpx;
  207. font-size: 26rpx;
  208. margin-left: 20rpx;
  209. display: flex;
  210. flex-direction: column;
  211. justify-content: space-around;
  212. }
  213. }
  214. .price-data {
  215. padding: 25rpx 20rpx;
  216. display: flex;
  217. flex-direction: column;
  218. view {
  219. padding: 15rpx 0;
  220. display: flex;
  221. justify-content: space-between;
  222. }
  223. }
  224. </style>