Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <view class="content">
  3. <image class="bg-image" mode="widthFix"
  4. src="https://qtzl.etcjz.cn/default-bucket/20240324/3eba2095f5204798a1f8101b_beijing.jpg"></image>
  5. <view class="content-re">
  6. <custom-header title="订单信息修改" :back="config.hasReturn === 'true'"></custom-header>
  7. <u-toast ref="uToastRef" />
  8. <view style="padding: 15rpx" v-if="isShow">
  9. <view class="container">
  10. <view class="ceil-content">
  11. <view class="item">
  12. <view class="item-l">订单状态</view>
  13. <view class="item-r">
  14. {{ formData.stepName }}
  15. </view>
  16. </view>
  17. <view class="item" v-if='formData.rejectReasonName'>
  18. <view class="item-l">审核原因</view>
  19. <view class="item-r">
  20. {{ formData.rejectReasonName }}
  21. </view>
  22. </view>
  23. <view class="item">
  24. <view class="item-l">车牌号码</view>
  25. <view class="item-r">
  26. {{ formData.vehiclePlate }}
  27. </view>
  28. </view>
  29. </view>
  30. <view class="ceil-content">
  31. <view class="item">
  32. <view class="item-l">用户信息修改</view>
  33. <view class="item-r link-nav" @click="handleToNav(1)">
  34. <text v-if='isXiuKey.userKey' class='txt'>重新修改</text>
  35. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  36. </view>
  37. </view>
  38. <view class="item">
  39. <view class="item-l">行驶证信息修改</view>
  40. <view class="item-r link-nav" @click="handleToNav(2)">
  41. <text v-if='isXiuKey.drKey' class='txt'>重新修改</text>
  42. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  43. </view>
  44. </view>
  45. </view>
  46. <button type="success" class="btn-txt btn" @click="submit">
  47. 确认修改
  48. </button>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script setup lang="ts">
  55. import { unifyTemplate } from '@/hooks/unifyTemplate';
  56. import { reactive, ref } from 'vue';
  57. import { onLoad } from '@dcloudio/uni-app';
  58. import { request } from '@/utils/network/request';
  59. import { setToken, getToken } from '@/utils/storage';
  60. import handleAmount from '@/utils/handleAmount.js';
  61. import {
  62. useAuditOrderStore
  63. } from '@/stores/auditOrder.js';
  64. const {
  65. CustomHeader, //头部组件
  66. initData, //初始化数据
  67. isShow, //是否展示formBuilderVue组件
  68. } = unifyTemplate(); //初始化数据
  69. // import {
  70. // request
  71. // } from '../../static/js/network/request'
  72. let formData = ref<any>({});
  73. let config = ref<any>({
  74. submitName: '提交',
  75. titleWidth: 160
  76. });
  77. let code = ref('');
  78. const auditOrderStore = useAuditOrderStore();
  79. onLoad((opin) => {
  80. // 初始化数据
  81. initData(opin, 7).then(async (data) => {
  82. console.log('新版1', data);
  83. handleData(data)
  84. isShow.value = true
  85. delete data.config.tableConfig;
  86. config.value = Object.assign(data.config, config.value);
  87. // await login(data); //无感登录
  88. handleSendParams(data.order)
  89. });
  90. });
  91. const reasonOptions = [
  92. { val: "1", label: "开户证件不合规" },
  93. { val: "2", label: "车辆证件不合规" },
  94. { val: "3", label: "车主证件不合规" },
  95. { val: "8", label: "其他" },
  96. { val: "5", label: "车辆图片不合格" },
  97. { val: "6", label: "不符合售后条件" },
  98. { val: "7", label: "原设备未回收" },
  99. { val: "4", label: "车型计算错误" },
  100. ]
  101. const orderStepOptions = [
  102. { val: 0, label: "未创建订单" },
  103. { val: 1, label: "完成填写订单初始化信息" },
  104. { val: 2, label: "完成个人/单位信息上传" },
  105. { val: 3, label: "待签约" },
  106. { val: 4, label: "完成车辆信息上传,待支付" },
  107. { val: 5, label: "完成订单支付。已支付" },
  108. { val: 6, label: "待审核" },
  109. { val: 7, label: "审核不通过" },
  110. { val: 8, label: "待发货" },
  111. { val: 9, label: "待收货" },
  112. { val: 10, label: "待激活" },
  113. ]
  114. const handleData = (data) => {
  115. formData.value = data.order
  116. formData.value.stepName = orderStepOptions.find(item => item.val === data.order.orderStep)?.label || '其它'
  117. formData.value.rejectReasonName = reasonOptions.find(rejItem => rejItem.val === data.order.rejectReason)?.label || data.order.rejectReason
  118. }
  119. // 无感登录,如果没有登录调用登录
  120. const loginData = ref({
  121. token: '',
  122. openId: ''
  123. });
  124. async function login(orderData) {
  125. let data = {
  126. userType: '',
  127. account: ''
  128. };
  129. if (orderData.order.userType === 'PERSONAL_USER') {
  130. // 个人办理
  131. data.userType = 'PERSONAL';
  132. data.account = orderData.order.customerTel;
  133. } else {
  134. // 单位办理
  135. data.userType = 'ENTERPRISE';
  136. data.account = orderData.order.customerIdnum;
  137. }
  138. await request('abaf0013caa24dafad12b0f571e8ee40', {
  139. data
  140. }).then((res) => {
  141. if (res.statusCode === 0) {
  142. let bizContent = JSON.parse(res.bizContent);
  143. // 保存token
  144. setToken(bizContent.accessToken);
  145. loginData.value.token = bizContent.accessToken;
  146. loginData.value.openId = bizContent.openId;
  147. }
  148. });
  149. }
  150. function handleToNav(navKey) {
  151. if (navKey === 1) {
  152. uni.navigateTo({
  153. url: '/pages/userInfoUploading/userInfoUploadingAudit',
  154. animationType: 'pop-in',
  155. animationDuration: 500
  156. });
  157. } else {
  158. uni.navigateTo({
  159. url: '/pages/drivingLicense/drivingLicenseAudit',
  160. animationType: 'pop-in',
  161. animationDuration: 500
  162. });
  163. }
  164. }
  165. const isXiuKey = reactive({
  166. userKey: false,
  167. drKey: false,
  168. })
  169. let sendParams = {}
  170. function handleSendParams(data) {
  171. sendParams = {}
  172. console.log(auditOrderStore, data.orderId);
  173. if (auditOrderStore.userData.orderId === data.orderId) {
  174. sendParams = {
  175. ...sendParams,
  176. ...auditOrderStore.userData,
  177. }
  178. isXiuKey.userKey = true
  179. } else {
  180. isXiuKey.userKey = false
  181. auditOrderStore.setUserData({})
  182. }
  183. if (auditOrderStore.drivingLicenseData.orderId === data.orderId) {
  184. sendParams = {
  185. ...sendParams,
  186. ...auditOrderStore.drivingLicenseData,
  187. }
  188. isXiuKey.drKey = true
  189. } else {
  190. isXiuKey.drKey = false
  191. auditOrderStore.setDrivingData({})
  192. }
  193. console.log(sendParams, 'sendParams');
  194. }
  195. //确认办理
  196. async function submit() {
  197. if (!isXiuKey.userKey) {
  198. uni.showModal({
  199. title: '提示',
  200. content: '请确认用户信息是否正确',
  201. success: function (res) {
  202. if (res.confirm) {
  203. uni.navigateTo({
  204. url: '/pages/userInfoUploading/userInfoUploadingAudit',
  205. animationType: 'pop-in',
  206. animationDuration: 500
  207. });
  208. } else if (res.cancel) {
  209. }
  210. }
  211. });
  212. return
  213. }
  214. if (!isXiuKey.drKey) {
  215. uni.showModal({
  216. title: '提示',
  217. content: '请确认行驶证相关信息是否正确',
  218. success: function (res) {
  219. if (res.confirm) {
  220. uni.navigateTo({
  221. url: '/pages/drivingLicense/drivingLicenseAudit',
  222. animationType: 'pop-in',
  223. animationDuration: 500
  224. });
  225. } else if (res.cancel) {
  226. }
  227. }
  228. });
  229. return
  230. }
  231. uni.showModal({
  232. title: '提示',
  233. content: '请确认所有信息是否正确',
  234. success: (res) => {
  235. if (res.confirm) {
  236. sendRequ()
  237. } else if (res.cancel) {
  238. }
  239. }
  240. });
  241. }
  242. function sendRequ() {
  243. console.log(sendParams, '请求参数');
  244. return request('83aa6ab9c8f441dda9ad75b46f00c805', {
  245. data: sendParams
  246. }).then((res) => {
  247. if (res.statusCode === 0) {
  248. console.log('修改成功');
  249. uni.navigateTo({
  250. url: '/pages/audit/auditSucess',
  251. animationType: 'pop-in',
  252. animationDuration: 500
  253. });
  254. } else {
  255. }
  256. })
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .content {
  261. height: 100%;
  262. // background-color: #eee;
  263. }
  264. .title {
  265. font-size: 30rpx;
  266. padding-bottom: 10rpx;
  267. color: #999;
  268. }
  269. .container {
  270. padding: 20rpx;
  271. font-size: 28rpx;
  272. .ceil-content {
  273. background-color: #fff;
  274. margin: 20rpx 0;
  275. border-radius: 14rpx;
  276. box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
  277. .item {
  278. display: flex;
  279. align-items: center;
  280. justify-content: space-between;
  281. padding: 30rpx 20rpx;
  282. border-bottom: 2rpx solid #eee;
  283. .link-nav {
  284. padding: 0 10rpx 0 30rpx;
  285. height: 100%;
  286. cursor: pointer;
  287. .txt {
  288. font-size: 26rpx;
  289. color: #999;
  290. }
  291. }
  292. }
  293. }
  294. }
  295. .payment-total {
  296. text-align: right;
  297. padding: 0 10px 20px;
  298. }
  299. .status {
  300. margin: 0;
  301. }
  302. .amount {
  303. color: #1aac1b;
  304. max-width: 450rpx;
  305. }
  306. .btn{
  307. margin-top: 40rpx;
  308. }
  309. </style>