detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <view>
  3. <navigator :url="detail.status == '待付款' ? '/store/deliveryAddress/index?title=选择地址' : '#'" @click="toSelect"
  4. class="address-box" :hover-class="detail.status == '待付款' ? 'navigator-hover' : ''">
  5. <view class="empty" v-if="address.rec_contactsid == 0">
  6. 请选择收货地址
  7. </view>
  8. <view class="contacts" v-else>
  9. <view class="label">
  10. <text class="iconfont icon-dizhi-hui" />
  11. <text style="margin-right: 10px;">
  12. {{ address.delivery_name }}
  13. </text>
  14. <text>
  15. {{ address.delivery_phonenumber }}
  16. </text>
  17. </view>
  18. <view class="address">
  19. {{ getCity(address) }}
  20. </view>
  21. </view>
  22. <view v-if="detail.status == '待付款'" class="iconfont icon-a-wodetiaozhuan" />
  23. </navigator>
  24. <view class="product">
  25. <u--image :src="detail.productCover" width="86" height="80" radius="8">
  26. <template v-slot:loading>
  27. <u-loading-icon color="red"></u-loading-icon>
  28. </template>
  29. </u--image>
  30. <view class="content">
  31. <view class="title u-line-1">{{ detail.itemname }}</view>
  32. <view class="price-box">
  33. 总计
  34. <text style="color: #E3041F;margin-left: 4px;">
  35. </text>
  36. <text class="price">
  37. {{ CNY(detail.amount, '') }}
  38. </text>
  39. <text style="color: #E3041F;margin-left: 4px;">
  40. </text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="store-info">
  45. <view class="title">
  46. 门店
  47. </view>
  48. <view class="content">
  49. <u--image width="60" height="62" radius="8" :src="detail.storeCover" lazy-load>
  50. <template v-slot:loading>
  51. <u-loading-icon color="red"></u-loading-icon>
  52. </template>
  53. </u--image>
  54. <view class="text-box" hover-class="navigator-hover" @click="goAtOnce(detail)">
  55. <view class="storename u-line-1" :style="{ width: detail.leader_phonenumber ? '230px' : '100%' }">
  56. {{ detail.storename }}
  57. </view>
  58. <view class="address u-line-1" :style="{ width: detail.leader_phonenumber ? '230px' : '100%' }">
  59. <text class="iconfont icon-dizhi-hui" />{{ detail.store_address }}
  60. </view>
  61. <view v-if="detail.leader_phonenumber" @click.stop="callPhone(detail.leader_phonenumber)"
  62. class="iconfont icon-dianhua" hover-class="navigator-hover" />
  63. </view>
  64. </view>
  65. </view>
  66. <view class="particulars">
  67. <view class="row">
  68. <view class="label">
  69. 订单编号
  70. </view>
  71. <view class="value">
  72. {{ detail.sonum }} |
  73. <text class="copy" @click="copy(detail.sonum, '订单编号')">
  74. 复制
  75. </text>
  76. </view>
  77. </view>
  78. <view class="row">
  79. <view class="label">
  80. 创建时间
  81. </view>
  82. <view class="value">
  83. {{ detail.createdate }}
  84. </view>
  85. </view>
  86. </view>
  87. <view class="footer">
  88. <view class="content">
  89. <view class="price-box">
  90. 总计:
  91. <view class="price">
  92. {{ CNY(detail.amount) }}
  93. </view>
  94. </view>
  95. <view class="submit" :class="address.contactsid == 0 || loading ? 'forbidden' : ''"
  96. hover-class="navigator-hover" @click="address.contactsid == 0 || loading ? '' : submit()">
  97. <u-loading-icon v-if="loading" />
  98. <block v-else>
  99. 支付
  100. </block>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. export default {
  108. data() {
  109. return {
  110. sa_custorderid: 0,
  111. detail: {},
  112. address: {
  113. delivery_name: "",
  114. delivery_phonenumber: "",
  115. rec_contactsid: "",
  116. province: "",
  117. city: "",
  118. county: "",
  119. address: "",
  120. }
  121. }
  122. },
  123. onLoad(options) {
  124. this.sa_custorderid = options.id;
  125. this.getDetail()
  126. uni.setNavigationBarTitle({
  127. title: '订单详情'
  128. });
  129. },
  130. methods: {
  131. getDetail() {
  132. this.$Http.basic({
  133. "id": 20240429152602,
  134. "content": {
  135. "sa_custorderid": this.sa_custorderid
  136. },
  137. }).then(res => {
  138. console.log("订单详情", res)
  139. res.data.storeCover = res.data.attinfos_store.length ? this.getSpecifiedImage(res.data.attinfos_store[0]) : uni.getStorageSync('site').logo || ''
  140. for (const key in this.address) {
  141. this.address[key] = res.data[key]
  142. }
  143. res.data.productCover = res.data.attinfos.length ? this.getSpecifiedImage(res.data.attinfos.find(s => s.usetype == "sa_fad") || v.attinfos[0]) : uni.getStorageSync("site").logo || ''
  144. this.detail = res.data;
  145. })
  146. },
  147. toSelect() {
  148. this.$Http.selectAddress = function (address) {
  149. address.delivery_name = address.name;
  150. address.delivery_phonenumber = address.phonenumber;
  151. address.rec_contactsid = address.contactsid;
  152. this.address = address;
  153. uni.navigateBack();
  154. delete this.$Http.selectAddress
  155. this.loading = true;
  156. this.$Http.basic({
  157. "id": 20240429152502,
  158. "content": {
  159. "sa_custorderid": this.detail.sa_custorderid,
  160. "items": [
  161. {
  162. "sa_fadid": this.detail.sa_fadid,
  163. "qty": this.detail.qty
  164. }
  165. ],
  166. "rec_contactsid": address.contactsid,
  167. "sys_enterpriseid": this.detail.sys_enterpriseid,
  168. "sa_storeid": this.detail.sa_storeid,
  169. "remarks": this.detail.remarks
  170. },
  171. }).then(res => {
  172. console.log("编辑", res)
  173. })
  174. }.bind(this)
  175. },
  176. copy(data, title) {
  177. uni.setClipboardData({
  178. data,
  179. success: (result) => {
  180. uni.showToast({
  181. title: "已复制" + title,
  182. icon: "none",
  183. duration: 1500,
  184. })
  185. }
  186. });
  187. },
  188. goAtOnce(item) {
  189. uni.openLocation({
  190. latitude: item.latitude - 0,
  191. longitude: item.longitude - 0,
  192. address: item.address,
  193. name: item.storename,
  194. success: function () {
  195. console.log('success');
  196. },
  197. fail: (fail) => {
  198. console.log('fail', fail)
  199. },
  200. });
  201. },
  202. },
  203. }
  204. </script>
  205. <style lang="scss" scoped>
  206. .address-box {
  207. display: flex;
  208. align-items: center;
  209. justify-content: space-between;
  210. margin-top: 10px;
  211. width: 100vw;
  212. height: 64px;
  213. background: #FFFFFF;
  214. padding: 0 10px;
  215. box-sizing: border-box;
  216. .empty {
  217. font-family: Source Han Sans SC, Source Han Sans SC;
  218. font-size: 14px;
  219. color: #333333;
  220. }
  221. .price {
  222. font-family: Source Han Sans SC, Source Han Sans SC;
  223. font-size: 16px;
  224. color: #E3041F;
  225. }
  226. .contacts {
  227. .label {
  228. line-height: 20px;
  229. font-family: Source Han Sans SC, Source Han Sans SC;
  230. font-weight: bold;
  231. font-size: 14px;
  232. color: #000000;
  233. .iconfont {
  234. font-size: 12px;
  235. color: #333333;
  236. margin-right: 5px;
  237. }
  238. }
  239. .address {
  240. line-height: 17px;
  241. font-family: Source Han Sans SC, Source Han Sans SC;
  242. font-size: 12px;
  243. color: #666666;
  244. margin-top: 7px;
  245. }
  246. }
  247. }
  248. .product {
  249. display: flex;
  250. width: 100vw;
  251. background: #fff;
  252. padding: 10px;
  253. box-sizing: border-box;
  254. margin-top: 10px;
  255. .content {
  256. margin-left: 20px;
  257. flex: 1;
  258. height: 100%;
  259. .title {
  260. line-height: 24px;
  261. font-family: Source Han Sans SC, Source Han Sans SC;
  262. font-weight: bold;
  263. font-size: 16px;
  264. color: #333333;
  265. margin-top: 10px;
  266. }
  267. .price-box {
  268. margin-top: 10px;
  269. font-size: 12px;
  270. color: #333333;
  271. .price {
  272. color: #E3041F;
  273. font-size: 18px;
  274. font-weight: bold;
  275. }
  276. }
  277. }
  278. }
  279. .store-info {
  280. background: #fff;
  281. padding: 10px;
  282. padding-top: 12px;
  283. margin-top: 10px;
  284. .title {
  285. line-height: 22px;
  286. font-family: PingFang SC, PingFang SC;
  287. font-weight: bold;
  288. font-size: 16px;
  289. color: #333333;
  290. }
  291. .content {
  292. display: flex;
  293. margin-top: 11px;
  294. .text-box {
  295. position: relative;
  296. flex: 1;
  297. height: 62px;
  298. background: #F5F5F5;
  299. border-radius: 5px;
  300. margin-left: 10px;
  301. box-sizing: border-box;
  302. padding: 10px;
  303. .storename {
  304. line-height: 20px;
  305. font-family: PingFang SC, PingFang SC;
  306. font-size: 14px;
  307. color: #333333;
  308. }
  309. .address {
  310. .iconfont {
  311. font-size: 12px;
  312. margin-right: 4px;
  313. }
  314. line-height: 17px;
  315. font-family: PingFang SC,
  316. PingFang SC;
  317. font-size: 12px;
  318. color: #888888;
  319. margin-top: 5px;
  320. }
  321. .icon-dianhua {
  322. position: absolute;
  323. right: 20px;
  324. top: 20px;
  325. font-size: 20px;
  326. color: #C30D23;
  327. }
  328. }
  329. }
  330. }
  331. .particulars {
  332. width: 100vw;
  333. background: #fff;
  334. margin-top: 10px;
  335. padding: 10px;
  336. box-sizing: border-box;
  337. .row {
  338. display: flex;
  339. align-items: center;
  340. margin-top: 14px;
  341. .label {
  342. line-height: 20px;
  343. font-family: Source Han Sans SC, Source Han Sans SC;
  344. font-size: 14px;
  345. color: #333333;
  346. width: 100px;
  347. }
  348. .value {
  349. flex: 1;
  350. text-align: right;
  351. line-height: 24px;
  352. font-family: Source Han Sans SC, Source Han Sans SC;
  353. font-size: 16px;
  354. color: #333333;
  355. .copy {
  356. margin-left: 5px;
  357. color: #999999;
  358. }
  359. }
  360. }
  361. .row:first-child {
  362. margin-top: 0;
  363. }
  364. }
  365. .footer {
  366. position: fixed;
  367. width: 100vw;
  368. height: 65px;
  369. background: #FFFFFF;
  370. box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
  371. bottom: 0;
  372. left: 0;
  373. padding: 10px;
  374. padding-top: 5px;
  375. box-sizing: border-box;
  376. .content {
  377. display: flex;
  378. align-items: center;
  379. justify-content: space-between;
  380. height: 45px;
  381. width: 100%;
  382. .price-box {
  383. display: flex;
  384. font-size: 14px;
  385. color: #333333;
  386. .price {
  387. color: #E3041F;
  388. font-size: 16px;
  389. font-weight: bold;
  390. }
  391. }
  392. .submit {
  393. display: flex;
  394. align-items: center;
  395. justify-content: center;
  396. width: 100px;
  397. height: 45px;
  398. background: #C30D23;
  399. border-radius: 5px;
  400. font-family: PingFang SC, PingFang SC;
  401. font-size: 14px;
  402. color: #FFFFFF;
  403. }
  404. }
  405. }
  406. </style>