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

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