orderInfo.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view class="content">
  3. <view class="address dfsb">
  4. <image src="/static/img/pro/malladdress.png" mode=""></image>
  5. <view class="addInfo">
  6. <view class="addInfo-title">
  7. <text>{{ newsInfo.shou_name || '姓名' }}</text>
  8. <text class="textgrey">{{ newsInfo.shou_phone || '手机号' }}</text>
  9. </view>
  10. <view class="addInfo-bot">{{ newsInfo.shou_address || '地址' }}</view>
  11. </view>
  12. </view>
  13. <!-- 订单列表 -->
  14. <view class="order-item">
  15. <block v-if="tabcur == 0">
  16. <view v-for="(ite, ind) in newsInfo.comments" class="shopshead dfsb">
  17. <image :src="ite.goods_img" mode=""></image>
  18. <view class="shopsInfo dffd">
  19. <view class="oneelli">{{ ite.goods_name }}</view>
  20. <view class="attr textgrey">{{ ite.sku_val }}</view>
  21. <view class="price dfsb prosecond">
  22. {{ ite.goods_price || 0.0 }}
  23. <text class="textgrey fontsm">x{{ ite.goods_num }}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </block>
  28. <block v-if="tabcur != 0">
  29. <view class="shopshead dfsb">
  30. <image :src="newsInfo.goods_img" mode=""></image>
  31. <view class="shopsInfo dffd">
  32. <view class="oneelli">{{ newsInfo.goods_name }}</view>
  33. <view class="attr textgrey">{{ newsInfo.sku_val }}</view>
  34. <view class="price dfsb prosecond">
  35. {{ newsInfo.goods_price || 0.0 }}
  36. <text class="textgrey fontsm">x{{ newsInfo.goods_num }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </block>
  41. <view class="allInfo dfsb">
  42. <text class="">备注</text>
  43. <text>{{ newsInfo.content || '无' }}</text>
  44. </view>
  45. <view class="allInfo dfsb">
  46. <text class="textgrey">运费</text>
  47. <text class="promain">¥{{ newsInfo.exp_fee || 0.0 }}</text>
  48. </view>
  49. <view class="allInfo dfsb">
  50. <text class="textgrey">优惠价格</text>
  51. <text class="promain">¥{{ newsInfo.coupon_price || 0.0 }}</text>
  52. </view>
  53. <view class="allInfo dfsb">
  54. <text class="textgrey">商品折扣</text>
  55. <text class="promain">{{ newsInfo.discount || 0 }}折</text>
  56. </view>
  57. <view class="allInfo dfsb">
  58. <text class="textgrey">商品总价</text>
  59. <text class="prosecond">¥{{ newsInfo.total_price || newsInfo.total }}</text>
  60. </view>
  61. <view class="allInfo spec dfsb">
  62. <text class="textmain">实付款</text>
  63. <text class="prosecond">¥{{ newsInfo.payment_price }}</text>
  64. </view>
  65. </view>
  66. <view class="order-item list">
  67. <view class="ordtitle">订单信息</view>
  68. <view class="allInfo dfsb">
  69. <text class="">订单编号</text>
  70. <text>{{ newsInfo.order_sn }}</text>
  71. <text @click="copy(newsInfo.order_sn)" class="prosecond">复制</text>
  72. </view>
  73. <view class="allInfo dfsb">
  74. <text class="">创建时间</text>
  75. <text>{{ newsInfo.create_time }}</text>
  76. </view>
  77. <view v-if="newsInfo.status > 1 && newsInfo.status < 5" class="allInfo dfsb">
  78. <text class="">运单号</text>
  79. <text>{{ newsInfo.exp_list.exp_no }}</text>
  80. </view>
  81. <view v-if="newsInfo.status > 1 && newsInfo.status < 5" class="allInfo dfsb">
  82. <text class="">快递公司</text>
  83. <text>{{ newsInfo.exp_list.exp_name }}</text>
  84. </view>
  85. <view v-if="newsInfo.status != 0" class="allInfo dfsb">
  86. <text class="">付款时间</text>
  87. <text>{{ newsInfo.pay_time }}</text>
  88. </view>
  89. <view v-if="newsInfo.status > 2" class="allInfo dfsb">
  90. <text class="">发货时间</text>
  91. <text>{{ newsInfo.deliver_time }}</text>
  92. </view>
  93. <view v-if="newsInfo.status > 3" class="allInfo dfsb">
  94. <text class="">完成时间</text>
  95. <text>{{ newsInfo.receiving_time }}</text>
  96. </view>
  97. <view class="fixBox dffs">
  98. <view v-if="newsInfo.status == 1" @tap.stop="sureOrd(newsInfo, 0)" class="cancle">取消</view>
  99. <view v-if="newsInfo.status > 1 && newsInfo.status < 5 && tabcur == 0" @tap.stop="sureOrd(newsInfo, 3)" class="cancle">售后</view>
  100. <view v-if="newsInfo.status == 1" @tap.stop="sureOrd(newsInfo, 1)" class="clickbtn">去付款</view>
  101. <view v-if="newsInfo.status == 3" @tap.stop="sureOrd(newsInfo, 2)" class="clickbtn">确认收货</view>
  102. <view v-if="newsInfo.status > 2 && newsInfo.status < 5" @tap.stop="sureOrd(newsInfo, 4)" class="clickbtn">查看物流</view>
  103. </view>
  104. </view>
  105. </view>
  106. </template>
  107. <script>
  108. import { mixin } from './mixin.js';
  109. export default {
  110. mixins: [mixin],
  111. data() {
  112. return {
  113. tabcur: '',
  114. id: '',
  115. // 付款
  116. showPaytype: false, //展示付款方式
  117. showPayexp: false, //展示邮费付款方式
  118. payexp: 1, //标志着支付邮费
  119. paytype: '', // 获取付款方式 1 zhigubao 2 weixin
  120. showPass: false, //密码
  121. newsInfo: { comments: [{}], status: 0 }
  122. };
  123. },
  124. onLoad(options) {
  125. this.id = options.id || '';
  126. this.tabcur = options.tabcur || 0;
  127. this.loadData();
  128. },
  129. onShow() {},
  130. methods: {
  131. loadData() {
  132. this.$api
  133. .request('orders/info', {
  134. type: Number(this.tabcur) + 1,
  135. id: this.id
  136. })
  137. .then(data => {
  138. if (data.code == 200) {
  139. this.newsInfo = data.data;
  140. } else {
  141. this.$api.toast(data.msg);
  142. }
  143. })
  144. .catch(function(error) {
  145. console.log(error);
  146. });
  147. },
  148. copy(val) {
  149. let content = val; //需要复制的内容
  150. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  151. const result = uniCopy(content);
  152. if (result === false) {
  153. uni.showToast({
  154. title: '不支持'
  155. });
  156. } else {
  157. uni.showToast({
  158. title: '复制成功,快分享给好友吧',
  159. icon: 'none'
  160. });
  161. }
  162. }
  163. }
  164. };
  165. </script>
  166. <style lang="scss">
  167. page,
  168. .content {
  169. background-color: #f5f5f5;
  170. min-height: 100vh;
  171. .groupInfo {
  172. padding: 32rpx;
  173. margin-bottom: 20rpx;
  174. background: linear-gradient(270deg, #e04f36 0%, #e02828 100%);
  175. image {
  176. width: 108rpx;
  177. height: 108rpx;
  178. margin-right: 32rpx;
  179. }
  180. .gpLeft {
  181. flex: 1;
  182. text {
  183. color: #fff;
  184. line-height: 42rpx;
  185. font-size: 30rpx;
  186. &:first-of-type {
  187. font-size: 36rpx;
  188. line-height: 50rpx;
  189. margin-bottom: 10rpx;
  190. }
  191. }
  192. }
  193. }
  194. .storeInfo {
  195. background: linear-gradient(90deg, #1f96f6 0%, #1388e7 100%);
  196. image {
  197. padding: 20rpx;
  198. }
  199. }
  200. }
  201. .address {
  202. padding: 30rpx;
  203. background-color: #fff;
  204. margin: 1rpx 0 22rpx;
  205. image {
  206. width: 30rpx;
  207. height: 40rpx;
  208. margin-right: 30rpx;
  209. }
  210. .addInfo {
  211. flex: 1;
  212. &-title {
  213. text {
  214. font-size: 32rpx;
  215. }
  216. text:nth-of-type(2) {
  217. font-size: 28rpx;
  218. margin-left: 12rpx;
  219. }
  220. }
  221. &-bot {
  222. margin-top: 10rpx;
  223. font-size: 28rpx;
  224. line-height: 40rpx;
  225. }
  226. }
  227. }
  228. .order-item {
  229. display: flex;
  230. flex-direction: column;
  231. background: #fff;
  232. padding: 30rpx;
  233. margin-bottom: 20rpx;
  234. .ordtitle {
  235. }
  236. .shopshead {
  237. height: 146rpx;
  238. margin: 32rpx 0 32rpx;
  239. image {
  240. width: 146rpx;
  241. height: 146rpx;
  242. border-radius: 10rpx;
  243. margin-right: 20rpx;
  244. }
  245. .shopsInfo {
  246. flex: 1;
  247. height: 100%;
  248. align-items: flex-start;
  249. justify-content: space-between;
  250. .elli {
  251. // height: 80rpx;
  252. line-height: 40rpx;
  253. }
  254. .price {
  255. width: 100%;
  256. }
  257. }
  258. }
  259. .attrBox {
  260. margin: 30rpx 0 20rpx;
  261. }
  262. .allInfo {
  263. width: 100%;
  264. margin-top: 30rpx;
  265. text-align: right;
  266. input,
  267. text {
  268. font-size: 28rpx;
  269. // color: $textgrey;
  270. &:nth-of-type(2) {
  271. flex: 1;
  272. text-align: right;
  273. }
  274. }
  275. }
  276. .spec {
  277. margin: 40rpx 0 0;
  278. text {
  279. font-size: 32rpx;
  280. color: $textcom;
  281. &:nth-of-type(2) {
  282. color: $promain;
  283. }
  284. }
  285. }
  286. .fixBox {
  287. justify-content: flex-end;
  288. .clickbtn,
  289. .cancle {
  290. width: 220rpx;
  291. font-size: 28rpx;
  292. border-radius: 0rpx;
  293. margin: 0;
  294. background: $red;
  295. box-shadow: 0 0 0 0;
  296. color: #fff;
  297. text-align: center;
  298. height: 100rpx;
  299. line-height: 100rpx;
  300. border-left: 1rpx solid #fff;
  301. }
  302. .cancle {
  303. background: #fff;
  304. color: #333;
  305. }
  306. }
  307. }
  308. .list {
  309. .allInfo {
  310. width: 100%;
  311. text {
  312. font-size: 28rpx;
  313. color: $textgrey;
  314. &:nth-of-type(2) {
  315. flex: 1;
  316. text-align: right;
  317. }
  318. }
  319. .prosecond {
  320. color: #fe4f00;
  321. }
  322. }
  323. }
  324. .tuiBox {
  325. margin: 30rpx;
  326. border: 1rpx solid #f5f5f5;
  327. height: 60rpx;
  328. padding: 10rpx;
  329. line-height: 60rpx;
  330. }
  331. </style>