toBeVerified.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <view class="container">
  3. <view class="order-item" style="padding: 200rpx 0; display: grid; place-items: center;">
  4. <!-- 订单 -->
  5. <view style="font-size: 48rpx; margin-bottom: 20rpx;">{{'1796545175311040513' }}</view>
  6. <view :style="{color: getStatusColor(list.status)}" style="font-size: 56rpx;">
  7. {{ getStatusText(list.status) }}
  8. </view>
  9. </view>
  10. <view class=" order-item">
  11. <view class="item-allnumb-box">
  12. <view class="allnumb-left">
  13. <image class="img" :src="list.avatar || '@/tatic/logo.png' " style="width: 50rpx; height: 50rpx" />
  14. <span style="margin-left:20rpx">{{list.memberUsername}}</span>
  15. </view>
  16. <view class="allnumb-right">
  17. <u-icon name="phone" color="#2979ff" size="24" @click="handlerMakePhone(list.mobile)" />
  18. </view>
  19. </view>
  20. <u-line margin="20rpx 0"></u-line>
  21. <view class="item-center" :key="idx" v-for="(itm, idx) of list.goodsInfo">
  22. <view class="center-left">
  23. <image :src="itm.goodsPic" class="img"></image>
  24. </view>
  25. <view class="center-right">
  26. <view class="r-l">
  27. <view class="right-name"> {{ itm.goodsName }} </view>
  28. <view class="right-descript"> 测试商品描述111 </view>
  29. <view class="l-box">
  30. <view class="right-price"> ¥{{ itm.goodsPrice }} </view>
  31. <view class="right-numb"> ×{{ itm.goodsQuantity }} </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="item-allnumb-box">
  37. <view class="allnumb-left"></view>
  38. <view class="allnumb-right">
  39. <span class="r-text">实付款</span>¥{{ list.payAmount }}
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 服务信息 -->
  44. <view class="order-item">
  45. <view style="font-size: 48rpx;margin-bottom: 10rpx;">服务信息</view>
  46. <view class="item-top">
  47. <view class="top-left gray-color">订单编号 : {{ list.id }}</view>
  48. <view class="top-right">
  49. <u-button type="primary" text="复制" size="mini" :plain="true" @click="ClipboardData"></u-button>
  50. </view>
  51. </view>
  52. <view class="item-top">
  53. <view class="top-left gray-color">下单时间 : {{ formatTime1(list.createTime) }}</view>
  54. <view class="top-right"></view>
  55. </view>
  56. <view class="item-top">
  57. <view class="top-left gray-color">备注 : {{ "--" }}</view>
  58. <view class="top-right"></view>
  59. </view>
  60. </view>
  61. <view class="btn"><u-button @click="compileHalend" type="primary" shape="circle" size="large"
  62. text="确认核销"></u-button></view>
  63. </view>
  64. </template>
  65. <script>
  66. import {
  67. getVerificationApi,
  68. } from '@/api/merchant/order'
  69. import {
  70. mapGetters
  71. } from 'vuex';
  72. export default {
  73. data() {
  74. return {
  75. list: {},
  76. };
  77. },
  78. computed: {
  79. ...mapGetters(['merchantId']),
  80. },
  81. mounted() {},
  82. onLoad(options) {
  83. console.log(options, "options");
  84. this.list = options.list[4]
  85. },
  86. onShow() {
  87. },
  88. methods: {
  89. ClipboardData(){
  90. // 在需要触发复制操作的事件中调用该方法
  91. uni.setClipboardData({
  92. data: this.list.id,
  93. success: function () {
  94. uni.showToast({
  95. title: '复制成功',
  96. icon: 'success'
  97. })
  98. }
  99. })
  100. },
  101. compileHalend() {
  102. console.log(this.list.id, this.merchantId,"this.list.id, this.merchantId")
  103. getVerificationApi(this.list.id, this.list.merchantId)
  104. .then(response => {
  105. uni.navigateTo({
  106. url:"/pageMerchant/storeModule/components/verificationStatus"
  107. })
  108. if (response.code == "OK") {
  109. // uni.navigateTo({
  110. // url:"/pageMerchant/storeModule/components/verificationStatus"
  111. // })
  112. // uni.showToast({
  113. // title: "核销成功",
  114. // icon: 'success',
  115. // dration: 2000,
  116. // });
  117. }
  118. })
  119. },
  120. handlerMakePhone() {
  121. console.log("打电话")
  122. },
  123. getStatusColor(status) {
  124. switch (status) {
  125. case 1:
  126. return 'blue';
  127. case 2:
  128. return 'red';
  129. case 3:
  130. return 'orange';
  131. case 4:
  132. return 'green';
  133. default:
  134. return 'black';
  135. }
  136. },
  137. getStatusText(status) {
  138. switch (status) {
  139. case 1:
  140. return '待核销';
  141. case 2:
  142. return '已核销';
  143. case 3:
  144. return '已退款';
  145. case 4:
  146. return '已过期';
  147. default:
  148. return '';
  149. }
  150. },
  151. formatTime1(timestamp) {
  152. const date = new Date(timestamp); // 转换为毫秒
  153. const year = date.getFullYear();
  154. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  155. const day = ('0' + date.getDate()).slice(-2);
  156. const hour = ('0' + date.getHours()).slice(-2);
  157. const minute = ('0' + date.getMinutes()).slice(-2);
  158. const second = ('0' + date.getSeconds()).slice(-2);
  159. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  160. }
  161. },
  162. };
  163. </script>
  164. <style lang="scss" scoped>
  165. .container{
  166. padding: 20rpx;
  167. }
  168. .order {
  169. margin-top: 10px;
  170. padding: 10rpx 20rpx 20rpx;
  171. box-sizing: border-box;
  172. }
  173. .order-item {
  174. margin-bottom: 20rpx;
  175. background-color: #fff;
  176. border-radius: 20rpx;
  177. padding: 20rpx;
  178. box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
  179. .item-top {
  180. display: flex;
  181. justify-content: space-between;
  182. margin-bottom: 10rpx;
  183. }
  184. .item-center {
  185. display: flex;
  186. align-items: center;
  187. margin-bottom: 10rpx;
  188. .center-left {
  189. height: 160rpx;
  190. .img {
  191. width: 160rpx;
  192. height: 160rpx;
  193. }
  194. }
  195. .center-right {
  196. width: 100%;
  197. height: 160rpx;
  198. display: flex;
  199. justify-content: space-between;
  200. margin-left: 20rpx;
  201. .r-l {
  202. display: flex;
  203. flex-direction: column;
  204. justify-content: space-around;
  205. .right-name {
  206. color: #4d5671;
  207. font-size: 32rpx;
  208. font-weight: bold;
  209. }
  210. .right-descript {
  211. font-size: 28rpx;
  212. color: #858797;
  213. }
  214. .l-box {
  215. display: flex;
  216. font-size: 24rpx;
  217. align-items: center;
  218. font-style: italic;
  219. .right-price {
  220. margin-right: 20rpx;
  221. font-weight: bold;
  222. font-size: 28rpx;
  223. color: #f57f32;
  224. }
  225. .right-numb {
  226. font-size: 24rpx;
  227. color: #858797;
  228. }
  229. }
  230. }
  231. .r-r {
  232. .r-item {
  233. align-items: center;
  234. }
  235. }
  236. }
  237. }
  238. .item-allnumb-box {
  239. display: flex;
  240. justify-content: space-between;
  241. align-items: center;
  242. font-weight: bold;
  243. .allnumb-left {
  244. display: flex;
  245. justify-content: start;
  246. align-items: center;
  247. font-size: 32rpx;
  248. .img {
  249. display: block;
  250. }
  251. }
  252. .allnumb-right {
  253. font-size: 26rpx;
  254. color: #f57f32;
  255. .r-text {
  256. color: #000;
  257. }
  258. }
  259. }
  260. }
  261. .item-bottom {
  262. width: 100%;
  263. margin-top: 20rpx;
  264. .btn {
  265. height: 70rpx;
  266. background-color: rgba(248, 213, 53, 0.8);
  267. color: #4e5059;
  268. font-size: 28rpx;
  269. text-align: center;
  270. line-height: 70rpx;
  271. border-radius: 20rpx;
  272. }
  273. }
  274. .gray-color {
  275. color: #858797;
  276. }
  277. ::deep .u-tabs__wrapper__nav__item__text {
  278. font-size: 30px;
  279. }
  280. .btn {
  281. margin-bottom: 50rpx;
  282. padding: 0 20rpx;
  283. }
  284. </style>