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

422 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
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. setTimeout(()=> {
  171. this.$url('/pages/index/index', {type: 'launch'});
  172. }, 300);
  173. //this.$url('/packages/sonpingDetail/sonpingDetail?id='+ id, {type: 'launch'}); // 关闭所有页面跳转到详情
  174. })
  175. })
  176. },
  177. // 稍后再填不记录快递信息
  178. saveTemporarily(){
  179. uni.showLoading({
  180. title: '正在保存当前信息'
  181. })
  182. let pages = getCurrentPages();
  183. let page = pages[pages.length - 2]; // 访问上一个页面
  184. let preData = page.data;
  185. let data = {
  186. note: preData.remarks,
  187. is_fast: Number(preData.isQuickReview),
  188. num: preData.sonpingInfo.number,
  189. tel: preData.sonpingInfo.phone,
  190. owner: preData.sonpingInfo.name,
  191. addr_id: preData.address.id,
  192. images: preData.fileList.map(item => item.url).join(','),
  193. type: preData.rateIndex,
  194. coupon: preData.coupon
  195. };
  196. addGrading(data).then(res => {
  197. uni.hideLoading();
  198. this.$msg('保存成功', {icon: 'success'}).then(() => {
  199. this.$toBack(2);
  200. })
  201. }).catch(err => uni.hideLoading());
  202. }
  203. }
  204. };
  205. </script>
  206. <style scoped lang="css">
  207. .bottom-group {
  208. position: relative;
  209. }
  210. .image_5 {
  211. width: 36rpx;
  212. height: 36rpx;
  213. }
  214. .equal-division-item {
  215. flex: 1 1 240rpx;
  216. padding: 10rpx 0;
  217. }
  218. .left-section {
  219. background-image: repeating-linear-gradient(
  220. 90deg,
  221. rgb(209, 161, 28),
  222. rgb(209, 161, 28) 2.4691358024691357%,
  223. transparent 2.4691358024691357%,
  224. transparent 14.814814814814815%
  225. );
  226. width: 162rpx;
  227. height: 2rpx;
  228. }
  229. .image_7 {
  230. border-radius: 50%;
  231. width: 80rpx;
  232. height: 80rpx;
  233. }
  234. .text_2 {
  235. margin-top: 20rpx;
  236. }
  237. .page {
  238. background-color: #f6f6f6;
  239. width: 100%;
  240. overflow-y: auto;
  241. height: 100%;
  242. }
  243. .group_3 {
  244. padding: 2rpx 0 16rpx;
  245. flex: 1 1 auto;
  246. overflow-y: auto;
  247. }
  248. .group_17 {
  249. margin-top: 60rpx;
  250. padding: 0 32rpx;
  251. }
  252. .view_3 {
  253. color: rgb(85, 85, 85);
  254. font-size: 28rpx;
  255. font-weight: 500;
  256. line-height: 40rpx;
  257. white-space: nowrap;
  258. }
  259. .section_2 {
  260. margin-top: 30rpx;
  261. padding: 40rpx 30rpx 40rpx 32rpx;
  262. background-color: rgb(255, 255, 255);
  263. }
  264. .section_3 {
  265. margin-top: 30rpx;
  266. padding: 40rpx 32rpx 44rpx;
  267. background-color: rgb(255, 255, 255);
  268. }
  269. .button {
  270. padding: 26rpx 0;
  271. color: rgb(255, 255, 255);
  272. font-size: 32rpx;
  273. font-weight: 600;
  274. line-height: 44rpx;
  275. white-space: nowrap;
  276. background-color: rgb(231, 162, 63);
  277. border-radius: 10rpx;
  278. }
  279. .text_19 {
  280. margin-top: 30rpx;
  281. align-self: center;
  282. color: rgb(119, 119, 119);
  283. font-size: 28rpx;
  284. font-weight: 500;
  285. line-height: 40rpx;
  286. white-space: nowrap;
  287. }
  288. .equal-division {
  289. padding: 30rpx 14rpx;
  290. background-color: rgb(255, 255, 255);
  291. }
  292. .group_8 {
  293. width: 404rpx;
  294. position: absolute;
  295. right: 166rpx;
  296. top: 79rpx;
  297. }
  298. .group_11 {
  299. margin-top: 50rpx;
  300. align-items: center;
  301. }
  302. .group_14 {
  303. margin-top: 40rpx;
  304. }
  305. .group_15 {
  306. margin-top: 50rpx;
  307. }
  308. .group_16 {
  309. margin-right: 26rpx;
  310. margin-top: 48rpx;
  311. }
  312. .image_11 {
  313. margin: 10rpx 0 8rpx;
  314. width: 44rpx;
  315. height: 44rpx;
  316. }
  317. .image_12 {
  318. margin: 4rpx 0;
  319. }
  320. .text_10 {
  321. color: rgb(51, 51, 51);
  322. font-size: 36rpx;
  323. font-weight: 600;
  324. line-height: 50rpx;
  325. white-space: nowrap;
  326. }
  327. .text_11 {
  328. margin: 6rpx 0 4rpx;
  329. color: rgb(231, 162, 63);
  330. font-size: 28rpx;
  331. font-weight: 500;
  332. line-height: 40rpx;
  333. white-space: nowrap;
  334. }
  335. .text_12 {
  336. color: rgb(119, 119, 119);
  337. font-size: 32rpx;
  338. font-weight: 500;
  339. line-height: 44rpx;
  340. white-space: nowrap;
  341. }
  342. .text_13 {
  343. margin-left: 42rpx;
  344. color: rgb(51, 51, 51);
  345. font-size: 32rpx;
  346. font-weight: 500;
  347. line-height: 44rpx;
  348. white-space: nowrap;
  349. }
  350. .text_14 {
  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_15 {
  358. margin-left: 10rpx;
  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_16 {
  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_17 {
  373. margin-left: 10rpx;
  374. flex: 1 1 auto;
  375. color: rgb(51, 51, 51);
  376. font-size: 32rpx;
  377. font-weight: 500;
  378. line-height: 48rpx;
  379. text-align: left;
  380. }
  381. .image_9 {
  382. width: 80rpx;
  383. height: 80rpx;
  384. }
  385. .text_6 {
  386. color: rgb(51, 51, 51);
  387. font-size: 32rpx;
  388. font-weight: 500;
  389. line-height: 44rpx;
  390. white-space: nowrap;
  391. }
  392. .text_7 {
  393. margin-left: 10rpx;
  394. color: rgb(119, 119, 119);
  395. font-size: 32rpx;
  396. font-weight: 500;
  397. line-height: 44rpx;
  398. white-space: nowrap;
  399. }
  400. .text_8 {
  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_9 {
  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. </style>