detail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <Theme>
  3. <Navbar fixed>
  4. <template #center>
  5. <view class="nav_title">
  6. <trans _t="店铺订单详情" />
  7. </view>
  8. </template>
  9. </Navbar>
  10. <view class="content">
  11. <view class="overview">
  12. <view class="img_box">
  13. <image
  14. class="img"
  15. mode="aspectFit"
  16. :src="queryData?.goods[0]['pic_url']"
  17. ></image>
  18. </view>
  19. <view class="information">
  20. <text class="name">{{ queryData?.goods[0]["goodTitle"] }}</text>
  21. <view
  22. v-for="(title, index) in queryData?.goods[0]['sku_desc'].split(';')"
  23. :key="index"
  24. >
  25. <text>{{ title }}</text>
  26. </view>
  27. <view class="num">x{{ queryData?.goods[0]["total"] }}</view>
  28. </view>
  29. </view>
  30. <view class="price_box">
  31. <text class="currency">{{ symbol.symbol }}:</text>
  32. <rich-text
  33. class="texts"
  34. :nodes="Moneyhtml(queryData?.goods[0]['price'])"
  35. ></rich-text>
  36. </view>
  37. <view class="dashed"></view>
  38. <view class="text_box" v-if="queryData.status == 300">
  39. <trans class="title" _t="运费"></trans>
  40. <view class="price_box">
  41. <text class="currency">{{ symbol.symbol }}</text>
  42. <rich-text
  43. class="texts"
  44. :nodes="Moneyhtml(queryData?.money)"
  45. ></rich-text>
  46. </view>
  47. </view>
  48. <view class="text_box" v-if="queryData?.payType">
  49. <trans class="title" _t="支付方式"></trans>
  50. <text>{{ queryData?.payType }}</text>
  51. </view>
  52. <view class="text_box">
  53. <trans class="title" _t="订单状态"></trans>
  54. <text>{{ queryData?.status_txt }}</text>
  55. </view>
  56. <view class="text_box">
  57. <trans class="title" _t="平台订单号"></trans>
  58. <up-copy
  59. :content="queryData?.orderNo"
  60. :notice="t('复制成功')"
  61. class="right_value"
  62. >
  63. <up-icon name="file-text" size="16px"></up-icon>
  64. <text>{{ queryData?.orderNo }}</text>
  65. </up-copy>
  66. </view>
  67. <view class="text_box" v-if="queryData?.payDate">
  68. <trans class="title" _t="订单时间"></trans>
  69. <text>{{ useGlobal().$format(queryData?.payDate) }}</text>
  70. </view>
  71. <!-- 地址信息 -->
  72. <view class="dashed" v-if="adrData"></view>
  73. <view class="address_box" v-if="adrData">
  74. <trans class="title" _t="收货地址"></trans>
  75. <view class="_item">
  76. <view class="_item_top">
  77. <view class="_top_left">
  78. <view class="name"
  79. >{{ adrData.firstName }}&nbsp;{{ adrData.lastName }}</view
  80. >
  81. <view class="phone">{{ adrData.phoneNo }}</view>
  82. <view class="code">{{ adrData.zipCode }}</view>
  83. </view>
  84. </view>
  85. <view class="_item_middle">
  86. {{ adrData.country }}&nbsp;{{ adrData.province }},{{
  87. adrData.city
  88. }},{{ adrData.address }}
  89. </view>
  90. </view>
  91. </view>
  92. <view class="dashed"></view>
  93. <view v-if="queryData.status == 300" class="popup_close" @click="buyCart">
  94. <trans class="menu_text" _t="去支付" />
  95. </view>
  96. <view class="popup_cancle" @click="onClose">
  97. <trans class="menu_text" _t="返回" />
  98. </view>
  99. </view>
  100. </Theme>
  101. </template>
  102. <script setup>
  103. import { ref, computed, watch, onMounted, nextTick } from "vue";
  104. import { useSystemStore } from "@/store";
  105. import { useGlobal, Moneyhtml, Modal, Toast } from "@/utils";
  106. import { t } from "@/locale";
  107. import Navbar from "@/components/navbar";
  108. import { onLoad } from "@dcloudio/uni-app";
  109. import { SELLER_SELLER_GETPAY, SHOP_ACTION, SELLER_SELLER_DETAIL } from "@/api";
  110. const parmes = ref(null);
  111. const useSystem = useSystemStore();
  112. const queryData = ref(null);
  113. const symbol = computed(() => useSystem.getSymbol);
  114. const adrData = ref(null);
  115. const onClose = () => {
  116. uni.navigateBack();
  117. };
  118. const buyCart = async (oid) => {
  119. const res = await SELLER_SELLER_GETPAY(parmes.value.id);
  120. toPay(res.data.sid);
  121. };
  122. const toPay = (oid) => {
  123. uni.navigateTo({
  124. url: `/pages/shop/payment?oid=${oid}&type=sellerpay`,
  125. });
  126. };
  127. const cancelModelRef = ref(null);
  128. const orderCancel = () => {
  129. cancelModelRef.value && cancelModelRef.value.open(queryData.value.id);
  130. };
  131. const getDetail = async () => {
  132. try {
  133. const res = await SELLER_SELLER_DETAIL(parmes.value.id);
  134. queryData.value = res.data;
  135. adrData.value = JSON.parse(res.data.adrData);
  136. } catch (error) {
  137. Toast(error.msg);
  138. }
  139. };
  140. onLoad((options) => {
  141. parmes.value = options;
  142. getDetail();
  143. });
  144. </script>
  145. <style lang="less" scoped>
  146. @import url("@/style.less");
  147. .scroll-Y {
  148. height: 300rpx;
  149. }
  150. .scroll-view_H {
  151. width: 280%;
  152. }
  153. .scroll-view-item_H {
  154. width: 35%;
  155. }
  156. .content {
  157. padding: 15rpx 5%;
  158. border-top: 1rpx solid #ccc;
  159. .popup_close {
  160. background-color: var(--black);
  161. color: var(--light);
  162. .flex_center();
  163. padding: 28rpx 0;
  164. border-radius: 20rpx;
  165. }
  166. .popup_cancle {
  167. background-color: var(--white);
  168. color: var(--black);
  169. .flex_center();
  170. border-radius: 20rpx;
  171. margin-top: 15rpx;
  172. padding: 28rpx 0;
  173. border: 1px solid var(--black);
  174. }
  175. .steps_box {
  176. width: 100%;
  177. overflow-x: scroll;
  178. margin: 20rpx 0;
  179. border: 1px solid #ccc;
  180. padding: 10rpx 0;
  181. }
  182. .overview {
  183. color: var(--text);
  184. .flex();
  185. gap: 24rpx;
  186. .img_box {
  187. flex: 2;
  188. border-radius: 20rpx;
  189. .img {
  190. width: 100%;
  191. height: 100%;
  192. }
  193. }
  194. .information {
  195. flex: 6;
  196. .size(24rpx);
  197. .name {
  198. // .ellipsis(2);
  199. margin-bottom: 26rpx;
  200. .size(28rpx);
  201. }
  202. .num {
  203. text-align: right;
  204. }
  205. }
  206. }
  207. .orginal_price {
  208. .hor(end);
  209. }
  210. .text_box {
  211. .flex_position(space-between, flex-end);
  212. margin: 8rpx 0;
  213. .size(24rpx);
  214. .title {
  215. color: var(--text-01);
  216. }
  217. .currency,
  218. .texts {
  219. color: var(--red);
  220. .size(28rpx);
  221. font-weight: 500;
  222. }
  223. .right_value {
  224. .flex();
  225. }
  226. }
  227. .price_box {
  228. .flex_position(end, flex-end);
  229. color: var(--black);
  230. .size(28rpx);
  231. .currency {
  232. margin-right: 10rpx;
  233. }
  234. }
  235. .texts /deep/ {
  236. .price {
  237. .size();
  238. }
  239. }
  240. .address_box {
  241. margin: 8rpx 0;
  242. .size(24rpx);
  243. .title {
  244. color: var(--text-01);
  245. margin-bottom: 12rpx;
  246. }
  247. ._item {
  248. overflow: hidden;
  249. &_top {
  250. .flex_position(space-between);
  251. padding-right: 30rpx;
  252. line-height: 60rpx;
  253. ._top_left {
  254. .ver();
  255. .name {
  256. .size(36rpx);
  257. font-weight: 700;
  258. color: var(--text);
  259. }
  260. .phone,
  261. .code {
  262. color: var(--text-01);
  263. margin-left: 30rpx;
  264. .size(28rpx);
  265. font-weight: 700;
  266. }
  267. }
  268. .icon-left {
  269. color: var(--text-01);
  270. transform: rotate(180deg);
  271. .size();
  272. }
  273. }
  274. &_middle {
  275. text-wrap: wrap;
  276. white-space: pre-wrap;
  277. word-wrap: break-word;
  278. .size(28rpx);
  279. color: var(--text-01);
  280. margin-top: 8rpx;
  281. line-height: 48rpx;
  282. margin-bottom: 12rpx;
  283. }
  284. }
  285. }
  286. .title_box {
  287. .size(28rpx);
  288. font-weight: 500;
  289. color: var(--text);
  290. }
  291. .hint {
  292. .size(24rpx);
  293. color: var(--text-01);
  294. margin-top: 10rpx;
  295. .steps-scroll-view {
  296. flex: 1;
  297. width: 100%;
  298. white-space: nowrap;
  299. padding: 24rpx 0;
  300. scroll-behavior: smooth;
  301. .custom-steps {
  302. display: inline-flex;
  303. min-width: 100%;
  304. .step-item {
  305. min-width: 120px;
  306. max-width: 180px;
  307. padding: 0 12rpx;
  308. box-sizing: border-box;
  309. white-space: normal;
  310. word-break: break-word;
  311. cursor: pointer;
  312. transition: all 0.3s;
  313. &:deep(.up-steps-item-title) {
  314. .size(28rpx);
  315. color: #333;
  316. font-weight: 500;
  317. // text-align: center;
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. </style>