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

419 lines
11 KiB

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