球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

436 lines
11 KiB

3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view class="flex-col page">
  3. <view class="flex-col group_3">
  4. <view class="flex-col">
  5. <view class="bottom-group flex-col view_3">
  6. <view class="flex-row equal-division">
  7. <view class="equal-division-item flex-col items-center">
  8. <image
  9. src="@/static/icon/tianxie4.png"
  10. class="image_7"
  11. />
  12. <text class="text_2">填写信息</text>
  13. </view>
  14. <view class="equal-division-item flex-col items-center">
  15. <image
  16. src="@/static/icon/tianxie5.png"
  17. class="image_9"
  18. />
  19. <text class="text_2">藏品寄送</text>
  20. </view>
  21. <view class="equal-division-item flex-col items-center">
  22. <image
  23. src="@/static/icon/tianxie3.png"
  24. class="image_7"
  25. />
  26. <text class="text_2">评级</text>
  27. </view>
  28. </view>
  29. <view class="justify-between group_8">
  30. <view class="left-section"> </view>
  31. <view class="left-section"> </view>
  32. </view>
  33. </view>
  34. <view class="flex-col section_2">
  35. <picker mode="selector" :range="expressList" range-key="label" @change="pickerChange">
  36. <view class="justify-between">
  37. <view class="flex-row">
  38. <text class="text_6">快递公司</text>
  39. <text class="text_7">{{expressList[expressIndex].label}}</text>
  40. </view>
  41. <image
  42. src="@/static/icon/rightArrow.png"
  43. class="image_11"
  44. />
  45. </view>
  46. </picker>
  47. <view class="justify-between group_11">
  48. <view class="flex-row" style="align-items: center;">
  49. <text class="text_8">快递单号</text>
  50. <!-- <text class="text_9">请填写快递单号</text> -->
  51. <u-input v-model="oddNumber" placeholder="请填写快递单号" maxlength="18"></u-input>
  52. </view>
  53. <image
  54. src="@/static/icon/tianxie6.png"
  55. class="image_5 image_12"
  56. @click="scan"
  57. />
  58. </view>
  59. </view>
  60. <view class="flex-col section_3">
  61. <view class="justify-between">
  62. <text class="text_10">寄送地址</text>
  63. <text class="text_11" @click="setClipboardData">一键复制</text>
  64. </view>
  65. <view class="flex-row group_14">
  66. <text class="text_12">收货人</text>
  67. <text class="text_13">{{ sendAddress.name }}</text>
  68. </view>
  69. <view class="flex-row group_15">
  70. <text class="text_14">联系电话</text>
  71. <text class="text_15">{{ sendAddress.tel }}</text>
  72. </view>
  73. <view class="flex-row group_16">
  74. <text class="text_16">收货地址</text>
  75. <text class="text_17">{{ sendAddress.address }}</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="flex-col group_17">
  80. <view class="flex-col items-center button" @click="submit">
  81. <text>送评</text>
  82. </view>
  83. <text class="text_19" @click="saveTemporarily" v-if="!$isRight(baseInfoCache)">稍后填写</text>
  84. <view style="width: 100%; height: 30rpx;"></view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import { addGrading } from '@/service/grading.js';
  91. import { sendAddr } from '@/service/address.js';
  92. import logistics from './logistics.json';
  93. export default {
  94. data() {
  95. return {
  96. oddNumber: '',
  97. expressList: logistics,
  98. expressIndex: 0,
  99. baseInfoCache: {},
  100. sendAddress: {
  101. name: '...',
  102. tel: '...',
  103. address: '...'
  104. },
  105. onSubmit:false,
  106. };
  107. },
  108. onLoad(options){
  109. if(this.$valueType(options.base_data) !== 'undefined'){
  110. this.baseInfoCache = JSON.parse(decodeURIComponent(options.base_data));
  111. }
  112. sendAddr().then((res) => {
  113. this.sendAddress = res.data.datas;
  114. });
  115. },
  116. methods: {
  117. setClipboardData(){
  118. let sendAddress = this.sendAddress;
  119. let str = `收货人:${sendAddress.name}\n联系电话:${sendAddress.tel}\n收货地址:${sendAddress.address}`;
  120. uni.setClipboardData({
  121. data: str
  122. })
  123. },
  124. scan(){
  125. uni.scanCode({
  126. complete: result => {
  127. console.log("hdjgdjhdjdhjdhdhdj", result)
  128. this.oddNumber = result.result;
  129. }
  130. })
  131. },
  132. pickerChange(event){
  133. this.expressIndex = event.detail.value;
  134. },
  135. submit(){
  136. if(this.expressIndex === '') return this.$msg('请选择快递公司');
  137. if(!this.oddNumber) return this.$msg('请输入快递单号');
  138. if(this.onSubmit) return;
  139. let data = {};
  140. this.onSubmit = true;
  141. uni.showLoading({
  142. title:"订单提交中"
  143. })
  144. if(this.$isRight(this.baseInfoCache)){ // 从我的订单 寄送藏品 进入的
  145. data = {
  146. express_type: this.expressList[this.expressIndex].label,
  147. express_numb: this.oddNumber,
  148. note: this.baseInfoCache.notes,
  149. is_fast: this.baseInfoCache.is_fast,
  150. num: this.baseInfoCache.num,
  151. tel: this.baseInfoCache.tel,
  152. owner: this.baseInfoCache.owner,
  153. addr_id: this.baseInfoCache.addr_log_id,
  154. images: this.baseInfoCache.images,
  155. order_id: this.baseInfoCache.order_id,
  156. type: this.baseInfoCache.type,
  157. coupon: this.baseInfoCache.coupon
  158. };
  159. }else{ // 默认从上一个填写页面进入的
  160. let pages = getCurrentPages();
  161. let page = pages[pages.length - 2]; // 访问上一个页面
  162. let preData = page.data;
  163. data = {
  164. express_type: this.expressList[this.expressIndex].label,
  165. express_numb: this.oddNumber,
  166. note: preData.remarks,
  167. is_fast: Number(preData.isQuickReview),
  168. num: preData.sonpingInfo.number,
  169. tel: preData.sonpingInfo.phone,
  170. owner: preData.sonpingInfo.name,
  171. addr_id: preData.address.id,
  172. images: preData.fileList.map(item => item.url).join(','),
  173. type: preData.rateIndex,
  174. coupon: preData.coupon
  175. };
  176. }
  177. addGrading(data).then(res => {
  178. let id = res.data.datas.order_id;
  179. this.$msg('提交成功', {icon: 'success'}).then(() => {
  180. setTimeout(()=> {
  181. this.onSubmit = false
  182. uni.hideLoading();
  183. this.$url('/pages/index/index', {type: 'launch'});
  184. }, 300);
  185. //this.$url('/packages/sonpingDetail/sonpingDetail?id='+ id, {type: 'launch'}); // 关闭所有页面跳转到详情
  186. }).catch((res)=>{
  187. this.onSubmit = false
  188. uni.hideLoading();
  189. });
  190. })
  191. },
  192. // 稍后再填不记录快递信息
  193. saveTemporarily(){
  194. uni.showLoading({
  195. title: '正在保存当前信息'
  196. })
  197. let pages = getCurrentPages();
  198. let page = pages[pages.length - 2]; // 访问上一个页面
  199. let preData = page.data;
  200. let data = {
  201. note: preData.remarks,
  202. is_fast: Number(preData.isQuickReview),
  203. num: preData.sonpingInfo.number,
  204. tel: preData.sonpingInfo.phone,
  205. owner: preData.sonpingInfo.name,
  206. addr_id: preData.address.id,
  207. images: preData.fileList.map(item => item.url).join(','),
  208. type: preData.rateIndex,
  209. coupon: preData.coupon
  210. };
  211. addGrading(data).then(res => {
  212. uni.hideLoading();
  213. this.$msg('保存成功', {icon: 'success'}).then(() => {
  214. this.$toBack(2);
  215. })
  216. }).catch(err => uni.hideLoading());
  217. }
  218. }
  219. };
  220. </script>
  221. <style scoped lang="css">
  222. .bottom-group {
  223. position: relative;
  224. }
  225. .image_5 {
  226. width: 36rpx;
  227. height: 36rpx;
  228. }
  229. .equal-division-item {
  230. flex: 1 1 240rpx;
  231. padding: 10rpx 0;
  232. }
  233. .left-section {
  234. background-image: repeating-linear-gradient(
  235. 90deg,
  236. rgb(209, 161, 28),
  237. rgb(209, 161, 28) 2.4691358024691357%,
  238. transparent 2.4691358024691357%,
  239. transparent 14.814814814814815%
  240. );
  241. width: 162rpx;
  242. height: 2rpx;
  243. }
  244. .image_7 {
  245. border-radius: 50%;
  246. width: 80rpx;
  247. height: 80rpx;
  248. }
  249. .text_2 {
  250. margin-top: 20rpx;
  251. }
  252. .page {
  253. background-color: #f6f6f6;
  254. width: 100%;
  255. overflow-y: auto;
  256. height: 100%;
  257. }
  258. .group_3 {
  259. padding: 2rpx 0 16rpx;
  260. flex: 1 1 auto;
  261. overflow-y: auto;
  262. }
  263. .group_17 {
  264. margin-top: 60rpx;
  265. padding: 0 32rpx;
  266. }
  267. .view_3 {
  268. color: rgb(85, 85, 85);
  269. font-size: 28rpx;
  270. font-weight: 500;
  271. line-height: 40rpx;
  272. white-space: nowrap;
  273. }
  274. .section_2 {
  275. margin-top: 30rpx;
  276. padding: 40rpx 30rpx 40rpx 32rpx;
  277. background-color: rgb(255, 255, 255);
  278. }
  279. .section_3 {
  280. margin-top: 30rpx;
  281. padding: 40rpx 32rpx 44rpx;
  282. background-color: rgb(255, 255, 255);
  283. }
  284. .button {
  285. padding: 26rpx 0;
  286. color: rgb(255, 255, 255);
  287. font-size: 32rpx;
  288. font-weight: 600;
  289. line-height: 44rpx;
  290. white-space: nowrap;
  291. background-color: rgb(231, 162, 63);
  292. border-radius: 10rpx;
  293. }
  294. .text_19 {
  295. margin-top: 30rpx;
  296. align-self: center;
  297. color: rgb(119, 119, 119);
  298. font-size: 28rpx;
  299. font-weight: 500;
  300. line-height: 40rpx;
  301. white-space: nowrap;
  302. }
  303. .equal-division {
  304. padding: 30rpx 14rpx;
  305. background-color: rgb(255, 255, 255);
  306. }
  307. .group_8 {
  308. width: 404rpx;
  309. position: absolute;
  310. right: 166rpx;
  311. top: 79rpx;
  312. }
  313. .group_11 {
  314. margin-top: 50rpx;
  315. align-items: center;
  316. }
  317. .group_14 {
  318. margin-top: 40rpx;
  319. }
  320. .group_15 {
  321. margin-top: 50rpx;
  322. }
  323. .group_16 {
  324. margin-right: 26rpx;
  325. margin-top: 48rpx;
  326. }
  327. .image_11 {
  328. margin: 10rpx 0 8rpx;
  329. width: 44rpx;
  330. height: 44rpx;
  331. }
  332. .image_12 {
  333. margin: 4rpx 0;
  334. }
  335. .text_10 {
  336. color: rgb(51, 51, 51);
  337. font-size: 36rpx;
  338. font-weight: 600;
  339. line-height: 50rpx;
  340. white-space: nowrap;
  341. }
  342. .text_11 {
  343. margin: 6rpx 0 4rpx;
  344. color: rgb(231, 162, 63);
  345. font-size: 28rpx;
  346. font-weight: 500;
  347. line-height: 40rpx;
  348. white-space: nowrap;
  349. }
  350. .text_12 {
  351. color: rgb(119, 119, 119);
  352. font-size: 32rpx;
  353. font-weight: 500;
  354. line-height: 44rpx;
  355. white-space: nowrap;
  356. }
  357. .text_13 {
  358. margin-left: 42rpx;
  359. color: rgb(51, 51, 51);
  360. font-size: 32rpx;
  361. font-weight: 500;
  362. line-height: 44rpx;
  363. white-space: nowrap;
  364. }
  365. .text_14 {
  366. color: rgb(119, 119, 119);
  367. font-size: 32rpx;
  368. font-weight: 500;
  369. line-height: 44rpx;
  370. white-space: nowrap;
  371. }
  372. .text_15 {
  373. margin-left: 10rpx;
  374. color: rgb(51, 51, 51);
  375. font-size: 32rpx;
  376. font-weight: 500;
  377. line-height: 44rpx;
  378. white-space: nowrap;
  379. }
  380. .text_16 {
  381. color: rgb(119, 119, 119);
  382. font-size: 32rpx;
  383. font-weight: 500;
  384. line-height: 44rpx;
  385. white-space: nowrap;
  386. }
  387. .text_17 {
  388. margin-left: 10rpx;
  389. flex: 1 1 auto;
  390. color: rgb(51, 51, 51);
  391. font-size: 32rpx;
  392. font-weight: 500;
  393. line-height: 48rpx;
  394. text-align: left;
  395. }
  396. .image_9 {
  397. width: 80rpx;
  398. height: 80rpx;
  399. }
  400. .text_6 {
  401. color: rgb(51, 51, 51);
  402. font-size: 32rpx;
  403. font-weight: 500;
  404. line-height: 44rpx;
  405. white-space: nowrap;
  406. }
  407. .text_7 {
  408. margin-left: 10rpx;
  409. color: rgb(119, 119, 119);
  410. font-size: 32rpx;
  411. font-weight: 500;
  412. line-height: 44rpx;
  413. white-space: nowrap;
  414. }
  415. .text_8 {
  416. color: rgb(51, 51, 51);
  417. font-size: 32rpx;
  418. font-weight: 500;
  419. line-height: 44rpx;
  420. white-space: nowrap;
  421. }
  422. .text_9 {
  423. margin-left: 10rpx;
  424. color: rgb(119, 119, 119);
  425. font-size: 32rpx;
  426. font-weight: 500;
  427. line-height: 44rpx;
  428. white-space: nowrap;
  429. }
  430. </style>