球星卡微信小程序
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.

405 lines
11 KiB

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="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893751612328.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="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497774314812625.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="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893767537982.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">{{ expressIndex !== '' ? expressList[expressIndex].label : '请选择快递公司' }}</text>
  40. </view>
  41. <image
  42. src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497774758380231.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="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497774389520756.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">评分卡部</text>
  68. </view>
  69. <view class="flex-row group_15">
  70. <text class="text_14">联系电话</text>
  71. <text class="text_15">18268905349</text>
  72. </view>
  73. <view class="flex-row group_16">
  74. <text class="text_16">收货地址</text>
  75. <text class="text_17">北京北京市西城区5号设计总院A座203室</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 logistics from './logistics.json';
  92. export default {
  93. data() {
  94. return {
  95. oddNumber: '',
  96. expressList: logistics,
  97. expressIndex: '',
  98. baseInfoCache: {}
  99. };
  100. },
  101. onLoad(options){
  102. if(this.$valueType(options.base_data) !== 'undefined'){
  103. this.baseInfoCache = JSON.parse(decodeURIComponent(options.base_data));
  104. }
  105. },
  106. methods: {
  107. setClipboardData(){
  108. uni.setClipboardData({
  109. data: '复制'
  110. })
  111. },
  112. scan(){
  113. uni.scanCode({
  114. complete: result => {
  115. this.oddNumber = result.result;
  116. }
  117. })
  118. },
  119. pickerChange(event){
  120. this.expressIndex = event.detail.value;
  121. },
  122. submit(){
  123. if(this.expressIndex === '') return this.$msg('请选择快递公司');
  124. if(!this.oddNumber) return this.$msg('请输入快递单号');
  125. let data = {};
  126. if(this.$isRight(this.baseInfoCache)){ // 从我的订单 寄送藏品 进入的
  127. data = {
  128. express_type: this.expressList[this.expressIndex].label,
  129. express_numb: this.oddNumber,
  130. note: this.baseInfoCache.notes,
  131. is_fast: this.baseInfoCache.is_fast,
  132. num: this.baseInfoCache.num,
  133. tel: this.baseInfoCache.tel,
  134. owner: this.baseInfoCache.owner,
  135. addr_id: this.baseInfoCache.addr_log_id,
  136. images: this.baseInfoCache.images,
  137. order_id: this.baseInfoCache.order_id
  138. };
  139. }else{ // 默认从上一个填写页面进入的
  140. let pages = getCurrentPages();
  141. let page = pages[pages.length - 2]; // 访问上一个页面
  142. let preData = page.data;
  143. data = {
  144. express_type: this.expressList[this.expressIndex].label,
  145. express_numb: this.oddNumber,
  146. note: preData.remarks,
  147. is_fast: Number(preData.isQuickReview),
  148. num: preData.sonpingInfo.number,
  149. tel: preData.sonpingInfo.phone,
  150. owner: preData.sonpingInfo.name,
  151. addr_id: preData.address.id,
  152. images: preData.fileList.map(item => item.url).join(',')
  153. };
  154. }
  155. addGrading(data).then(res => {
  156. let id = res.data.datas.order_id;
  157. this.$msg('提交成功', {icon: 'success'}).then(() => {
  158. this.$url('/packages/sonpingDetail/sonpingDetail?id='+ id, {type: 'launch'}); // 关闭所有页面跳转到详情
  159. })
  160. })
  161. },
  162. // 稍后再填不记录快递信息
  163. saveTemporarily(){
  164. uni.showLoading({
  165. title: '正在保存当前信息'
  166. })
  167. let pages = getCurrentPages();
  168. let page = pages[pages.length - 2]; // 访问上一个页面
  169. let preData = page.data;
  170. let data = {
  171. note: preData.remarks,
  172. is_fast: Number(preData.isQuickReview),
  173. num: preData.sonpingInfo.number,
  174. tel: preData.sonpingInfo.phone,
  175. owner: preData.sonpingInfo.name,
  176. addr_id: preData.address.id,
  177. images: preData.fileList.map(item => item.url).join(',')
  178. };
  179. addGrading(data).then(res => {
  180. uni.hideLoading();
  181. this.$msg('保存成功', {icon: 'success'}).then(() => {
  182. this.$toBack(2);
  183. })
  184. }).catch(err => uni.hideLoading());
  185. }
  186. }
  187. };
  188. </script>
  189. <style scoped lang="css">
  190. .bottom-group {
  191. position: relative;
  192. }
  193. .image_5 {
  194. width: 36rpx;
  195. height: 36rpx;
  196. }
  197. .equal-division-item {
  198. flex: 1 1 240rpx;
  199. padding: 10rpx 0;
  200. }
  201. .left-section {
  202. background-image: repeating-linear-gradient(
  203. 90deg,
  204. rgb(209, 161, 28),
  205. rgb(209, 161, 28) 2.4691358024691357%,
  206. transparent 2.4691358024691357%,
  207. transparent 14.814814814814815%
  208. );
  209. width: 162rpx;
  210. height: 2rpx;
  211. }
  212. .image_7 {
  213. border-radius: 50%;
  214. width: 80rpx;
  215. height: 80rpx;
  216. }
  217. .text_2 {
  218. margin-top: 20rpx;
  219. }
  220. .page {
  221. background-color: #f6f6f6;
  222. width: 100%;
  223. overflow-y: auto;
  224. height: 100%;
  225. }
  226. .group_3 {
  227. padding: 2rpx 0 16rpx;
  228. flex: 1 1 auto;
  229. overflow-y: auto;
  230. }
  231. .group_17 {
  232. margin-top: 60rpx;
  233. padding: 0 32rpx;
  234. }
  235. .view_3 {
  236. color: rgb(85, 85, 85);
  237. font-size: 28rpx;
  238. font-weight: 500;
  239. line-height: 40rpx;
  240. white-space: nowrap;
  241. }
  242. .section_2 {
  243. margin-top: 30rpx;
  244. padding: 40rpx 30rpx 40rpx 32rpx;
  245. background-color: rgb(255, 255, 255);
  246. }
  247. .section_3 {
  248. margin-top: 30rpx;
  249. padding: 40rpx 32rpx 44rpx;
  250. background-color: rgb(255, 255, 255);
  251. }
  252. .button {
  253. padding: 26rpx 0;
  254. color: rgb(255, 255, 255);
  255. font-size: 32rpx;
  256. font-weight: 600;
  257. line-height: 44rpx;
  258. white-space: nowrap;
  259. background-color: rgb(231, 162, 63);
  260. border-radius: 10rpx;
  261. }
  262. .text_19 {
  263. margin-top: 30rpx;
  264. align-self: center;
  265. color: rgb(119, 119, 119);
  266. font-size: 28rpx;
  267. font-weight: 500;
  268. line-height: 40rpx;
  269. white-space: nowrap;
  270. }
  271. .equal-division {
  272. padding: 30rpx 14rpx;
  273. background-color: rgb(255, 255, 255);
  274. }
  275. .group_8 {
  276. width: 404rpx;
  277. position: absolute;
  278. right: 166rpx;
  279. top: 79rpx;
  280. }
  281. .group_11 {
  282. margin-top: 50rpx;
  283. align-items: center;
  284. }
  285. .group_14 {
  286. margin-top: 40rpx;
  287. }
  288. .group_15 {
  289. margin-top: 50rpx;
  290. }
  291. .group_16 {
  292. margin-right: 26rpx;
  293. margin-top: 48rpx;
  294. }
  295. .image_11 {
  296. margin: 10rpx 0 8rpx;
  297. width: 16rpx;
  298. height: 26rpx;
  299. }
  300. .image_12 {
  301. margin: 4rpx 0;
  302. }
  303. .text_10 {
  304. color: rgb(51, 51, 51);
  305. font-size: 36rpx;
  306. font-weight: 600;
  307. line-height: 50rpx;
  308. white-space: nowrap;
  309. }
  310. .text_11 {
  311. margin: 6rpx 0 4rpx;
  312. color: rgb(231, 162, 63);
  313. font-size: 28rpx;
  314. font-weight: 500;
  315. line-height: 40rpx;
  316. white-space: nowrap;
  317. }
  318. .text_12 {
  319. color: rgb(119, 119, 119);
  320. font-size: 32rpx;
  321. font-weight: 500;
  322. line-height: 44rpx;
  323. white-space: nowrap;
  324. }
  325. .text_13 {
  326. margin-left: 42rpx;
  327. color: rgb(51, 51, 51);
  328. font-size: 32rpx;
  329. font-weight: 500;
  330. line-height: 44rpx;
  331. white-space: nowrap;
  332. }
  333. .text_14 {
  334. color: rgb(119, 119, 119);
  335. font-size: 32rpx;
  336. font-weight: 500;
  337. line-height: 44rpx;
  338. white-space: nowrap;
  339. }
  340. .text_15 {
  341. margin-left: 10rpx;
  342. color: rgb(51, 51, 51);
  343. font-size: 32rpx;
  344. font-weight: 500;
  345. line-height: 44rpx;
  346. white-space: nowrap;
  347. }
  348. .text_16 {
  349. color: rgb(119, 119, 119);
  350. font-size: 32rpx;
  351. font-weight: 500;
  352. line-height: 44rpx;
  353. white-space: nowrap;
  354. }
  355. .text_17 {
  356. margin-left: 10rpx;
  357. flex: 1 1 auto;
  358. color: rgb(51, 51, 51);
  359. font-size: 32rpx;
  360. font-weight: 500;
  361. line-height: 48rpx;
  362. text-align: left;
  363. }
  364. .image_9 {
  365. width: 80rpx;
  366. height: 80rpx;
  367. }
  368. .text_6 {
  369. color: rgb(51, 51, 51);
  370. font-size: 32rpx;
  371. font-weight: 500;
  372. line-height: 44rpx;
  373. white-space: nowrap;
  374. }
  375. .text_7 {
  376. margin-left: 10rpx;
  377. color: rgb(119, 119, 119);
  378. font-size: 32rpx;
  379. font-weight: 500;
  380. line-height: 44rpx;
  381. white-space: nowrap;
  382. }
  383. .text_8 {
  384. color: rgb(51, 51, 51);
  385. font-size: 32rpx;
  386. font-weight: 500;
  387. line-height: 44rpx;
  388. white-space: nowrap;
  389. }
  390. .text_9 {
  391. margin-left: 10rpx;
  392. color: rgb(119, 119, 119);
  393. font-size: 32rpx;
  394. font-weight: 500;
  395. line-height: 44rpx;
  396. white-space: nowrap;
  397. }
  398. </style>