ExchangeOrder.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <view class="create-order" :class="['qn-page-' + theme]">
  3. <view class="confirm_box">
  4. <view class="address-bg primary-bg"></view>
  5. <view class="main-view-box" style="background-color: #FFFFFF;">
  6. <view class="delivery-ul"><view class="delivery-li primary-t-bg">收货信息</view></view>
  7. <view @click="goPage('/pages/address/address?source=1')" class="address-section ">
  8. <view class="order-content">
  9. <view class="ibonfont ibonicon-test icon-address primary-bg"></view>
  10. <view v-if="addressData.id" class="cen">
  11. <view class="top">
  12. <text class="name">{{ addressData.name }}</text>
  13. <text class="mobile">{{ addressData.mobile }}</text>
  14. </view>
  15. <text class="address">
  16. {{ addressData.area.provinceName }}{{ addressData.area.cityName }}{{ addressData.area.districtName }}{{ addressData.address }}
  17. </text>
  18. </view>
  19. <text v-if="addressData.id" class="ibonfont ibonjinru"></text>
  20. <view v-else class="empty-tips primary-color">
  21. <u-icon name="plus" margin-right="10"></u-icon>
  22. 去添加收货地址
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="goods-view model-view">
  29. <view class="goods-li clearfix">
  30. <view class="goods-img float_left"><u-image border-radius="10rpx" width="124rpx" height="124rpx" :src="goods_detail.images[0]"></u-image></view>
  31. <view class="goods-info float_left">
  32. <view class="goods-name ellipsis">{{ goods_detail.name }}</view>
  33. <view class="price-num clearfix">
  34. <view class="float_left now-price">
  35. <text class="pn-text">{{ goods_detail.integral||'0' }}股权</text>
  36. </view>
  37. <view class="float_right goods-num">
  38. <u-number-box :min="1" v-model="buyNum" :input-height="44" @plus="valChange" @minus="valChange" @blur="valBlur"></u-number-box>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="remarks">
  44. <text class="remarks-label">买家留言</text>
  45. <input type="text" placeholder="留言前建议先与商家协调一致" v-model="remarks" />
  46. </view>
  47. </view>
  48. <view class="footer-view clearfix">
  49. <view class="float_left">
  50. 实付
  51. <text class="price-num total-price">{{ goods_detail.integral || 0 }}</text>
  52. <text class="rmb-icon">股权</text>
  53. </view>
  54. <view class="sub-btn float_right primary-btn" @click="subOrder">提交</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. buyNum: 1,
  63. goods_detail: {},
  64. cart_data: {
  65. lists: []
  66. }, //
  67. self_show: false,
  68. coupon_pop: false, //优惠券弹窗
  69. coupon_price: '',
  70. self_shop: [], // 自提点列表
  71. pay_show: false, // 选择支付方式
  72. remarks: '',
  73. addressData: {},
  74. goods_data: {} // 立即购买
  75. };
  76. },
  77. onPullDownRefresh() {
  78. this.getIntegralGoodsInfo();
  79. },
  80. onLoad(options) {
  81. // 地址
  82. this.getAllShippingAddress();
  83. // 确认订单数据
  84. if (options.id) {
  85. this.goods_id = options.id;
  86. this.getIntegralGoodsInfo();
  87. }
  88. // 根据主题设置顶部颜色
  89. uni.setNavigationBarColor({
  90. frontColor: '#ffffff',
  91. backgroundColor: this.theme === 'red' ? '#e02020' : this.primaryColor
  92. });
  93. },
  94. methods: {
  95. // 请求商品品详情
  96. async getIntegralGoodsInfo() {
  97. this.$u.api.getIntegralGoodsInfo(this.goods_id).then(({ data }) => {
  98. uni.setNavigationBarTitle({
  99. title: data.name
  100. });
  101. this.imgList = data.images;
  102. this.goods_detail = data;
  103. });
  104. },
  105. // 获取收货地址
  106. getAllShippingAddress() {
  107. this.$u.api
  108. .getAllShippingAddress({
  109. page: 1,
  110. pageSize: 1
  111. })
  112. .then(({ data }) => {
  113. if (data.length) {
  114. const defaultObj = data.find(item => item.defaultStatus === 5) || data[0];
  115. this.addressData = defaultObj;
  116. }
  117. });
  118. },
  119. //提交订单
  120. subOrder() {
  121. this.$u.api
  122. .addIntegralGoodsExchange({
  123. goodsId: this.goods_id,
  124. num: this.buyNum,
  125. address: this.addressData,
  126. remark: this.remarks
  127. })
  128. .then(res => {
  129. this.$u.toast('提交成功');
  130. setTimeout(() => {
  131. this.goPage('/pagesT/pointsMall/ExchangeLog', 'redirectTo');
  132. }, 200);
  133. });
  134. },
  135. valChange(e) {
  136. this.goods_data.buyNum = e.value;
  137. },
  138. valBlur(e) {
  139. this.goods_data.buyNum = e.value;
  140. }
  141. }
  142. };
  143. </script>
  144. <style lang="scss">
  145. .confirm_box {
  146. width: 100%;
  147. padding: 20upx 20upx 0;
  148. min-height: 100%;
  149. position: relative;
  150. .main-view-box {
  151. border-radius: 10upx;
  152. }
  153. .address-bg {
  154. position: absolute;
  155. background-color: #fe4543;
  156. top: 0;
  157. left: 0;
  158. width: 100%;
  159. height: 180upx;
  160. }
  161. .delivery-ul {
  162. display: flex;
  163. margin-top: 30upx;
  164. line-height: 70upx;
  165. height: 70upx;
  166. .delivery-li {
  167. padding-left: 20rpx;
  168. font-size: 28upx;
  169. background: #ff7d7d;
  170. color: #ffffff;
  171. flex: 3;
  172. position: relative;
  173. &:first-child {
  174. border-top-left-radius: 10rpx;
  175. }
  176. &:last-child {
  177. border-top-right-radius: 10rpx;
  178. }
  179. }
  180. .delivery-li:first-child .check-bg {
  181. border-top-left-radius: 10rpx;
  182. }
  183. .delivery-li:nth-child(2) .check-bg {
  184. background: linear-gradient(110deg, transparent 30upx, #ffffff 0) top left, linear-gradient(-110deg, transparent 30upx, #ffffff 0) top right;
  185. background-size: 60% 100%;
  186. background-repeat: no-repeat;
  187. }
  188. .delivery-li:last-child .check-bg {
  189. background: linear-gradient(113deg, transparent 32upx, #ffffff 0);
  190. border-top-right-radius: 10rpx;
  191. }
  192. .delivery-on {
  193. color: #333333;
  194. .check-bg {
  195. display: block;
  196. }
  197. }
  198. }
  199. .address-section {
  200. padding: 30upx 0;
  201. background: #fff;
  202. position: relative;
  203. border-radius: 0 0 10upx 10upx;
  204. .empty-tips {
  205. color: $uni-color-primary;
  206. }
  207. .order-content {
  208. display: flex;
  209. align-items: center;
  210. }
  211. .icon-address {
  212. display: inline-block;
  213. margin-left: 20upx;
  214. margin-right: 20upx;
  215. width: 60upx;
  216. height: 60upx;
  217. line-height: 60upx;
  218. text-align: center;
  219. border-radius: 100%;
  220. font-size: 32upx;
  221. color: #ffffff;
  222. background-color: #fe4543;
  223. }
  224. .cen {
  225. display: flex;
  226. flex-direction: column;
  227. flex: 1;
  228. font-size: 28upx;
  229. color: $font-color-dark;
  230. }
  231. .mobile,
  232. .name {
  233. font-size: 26upx;
  234. margin-right: 20upx;
  235. }
  236. .address {
  237. margin-top: 10upx;
  238. margin-right: 20upx;
  239. font-size: 24upx;
  240. color: $font-color-light;
  241. .mobile,
  242. .name {
  243. font-size: 24upx;
  244. }
  245. }
  246. .ibonjinru {
  247. font-size: 32upx;
  248. color: $font-color-light;
  249. margin-right: 30upx;
  250. }
  251. .a-bg {
  252. position: absolute;
  253. left: 0;
  254. bottom: 0;
  255. display: block;
  256. width: 100%;
  257. height: 5upx;
  258. }
  259. }
  260. }
  261. .goods-view {
  262. .remarks {
  263. padding: 30upx 0;
  264. .remarks-label {
  265. font-size: 24upx;
  266. }
  267. input {
  268. width: 540upx;
  269. font-size: 24upx;
  270. display: inline-block;
  271. vertical-align: middle;
  272. margin-left: 20upx;
  273. text-align: right;
  274. }
  275. }
  276. .goods-li {
  277. padding: 30upx 0;
  278. border-bottom: 1upx solid #f4f4f4;
  279. .goods-img {
  280. padding-right: 20upx;
  281. }
  282. .goods-info {
  283. width: 520upx;
  284. font-size: 28upx;
  285. .goods-name {
  286. .activity-tag {
  287. color: #fff;
  288. display: inline-block;
  289. padding: 0 6upx;
  290. border-radius: 6rpx;
  291. background: linear-gradient(to right, #ff3859, #ff2d2e);
  292. .ibonfont {
  293. font-size: 22rpx;
  294. }
  295. margin-right: 10upx;
  296. line-height: 26rpx;
  297. }
  298. }
  299. .goods-sku {
  300. font-size: 22upx;
  301. padding: 10upx 0;
  302. color: #999999;
  303. }
  304. .price-num {
  305. font-size: 28upx;
  306. .pn-text {
  307. font-weight: 600;
  308. }
  309. .goods-num {
  310. color: #333333;
  311. .u-number-input {
  312. background-color: #ffffff !important;
  313. }
  314. .u-icon-plus {
  315. border-radius: 8rpx !important;
  316. width: 44rpx !important;
  317. font-size: 24rpx;
  318. }
  319. .u-icon-disabled {
  320. border-radius: 8rpx !important;
  321. width: 44rpx !important;
  322. font-size: 24rpx;
  323. }
  324. .u-icon-minus {
  325. border-radius: 8rpx !important;
  326. width: 44rpx !important;
  327. font-size: 24rpx;
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. .model-view {
  335. background-color: #ffffff;
  336. width: 706upx;
  337. margin: 20upx auto 0;
  338. border-radius: 10upx;
  339. padding: 0 20upx;
  340. .model-val {
  341. font-size: 28upx;
  342. }
  343. .model-label {
  344. font-size: 26upx;
  345. }
  346. .ibonjinru {
  347. font-size: 24upx;
  348. color: #999999;
  349. margin-left: 10upx;
  350. }
  351. }
  352. .coupon-box {
  353. padding: 30upx 20upx;
  354. .no-sel {
  355. font-size: 24upx;
  356. color: #999999;
  357. font-weight: 400;
  358. }
  359. .model-label {
  360. .icon-tag {
  361. font-size: 18upx;
  362. color: #ffffff;
  363. background-color: #fe4543;
  364. display: inline-block;
  365. width: 26upx;
  366. line-height: 26upx;
  367. text-align: center;
  368. margin-right: 10upx;
  369. vertical-align: middle;
  370. }
  371. }
  372. }
  373. .price-num {
  374. color: $price-color;
  375. font-size: 26upx;
  376. font-weight: 600;
  377. }
  378. .price-box {
  379. .price-li {
  380. line-height: 80upx;
  381. .model-val {
  382. font-weight: 600;
  383. }
  384. }
  385. }
  386. .footer-view {
  387. position: fixed;
  388. width: 100%;
  389. bottom: 0;
  390. left: 0;
  391. background-color: #ffffff;
  392. padding: 10upx 20upx;
  393. border-top: 1px solid #f4f4f4;
  394. line-height: 74upx;
  395. .float_left {
  396. font-size: 26upx;
  397. color: #999999;
  398. .rmb-icon {
  399. color: $price-color;
  400. margin-left: 20upx;
  401. }
  402. .price-num {
  403. font-weight: 500;
  404. font-size: 50upx;
  405. }
  406. }
  407. .sub-btn {
  408. height: 74upx;
  409. width: 204upx;
  410. border-radius: 10upx;
  411. line-height: 74upx;
  412. text-align: center;
  413. font-size: 28upx;
  414. color: #fff;
  415. background-color: #fe4543;
  416. }
  417. }
  418. .create-order {
  419. padding-bottom: 110upx;
  420. }
  421. </style>