Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

install-activation-order.vue 10KB

il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 7 mois
il y a 2 ans
il y a 7 mois
il y a 2 ans
il y a 7 mois
il y a 2 ans
il y a 2 ans
il y a 10 mois
il y a 7 mois
il y a 10 mois
il y a 7 mois
il y a 10 mois
il y a 7 mois
il y a 2 ans
il y a 2 ans
il y a 7 mois
il y a 2 ans
il y a 10 mois
il y a 10 mois
il y a 7 mois
il y a 2 ans
il y a 9 mois
il y a 2 ans
il y a 10 mois
il y a 9 mois
il y a 7 mois
il y a 9 mois
il y a 7 mois
il y a 9 mois
il y a 7 mois
il y a 9 mois
il y a 10 mois
il y a 10 mois
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 10 mois
il y a 10 mois
il y a 2 ans
il y a 10 mois
il y a 2 ans
il y a 2 ans
il y a 10 mois
il y a 10 mois
il y a 2 ans
il y a 2 ans
il y a 1 an
il y a 1 an
il y a 1 an
il y a 1 an
il y a 1 an
il y a 10 mois
il y a 10 mois
il y a 7 mois
il y a 1 an
il y a 7 mois
il y a 7 mois
il y a 10 mois
il y a 1 an
il y a 2 ans
il y a 10 mois
il y a 10 mois
il y a 10 mois
il y a 11 mois
il y a 10 mois
il y a 10 mois
il y a 10 mois
il y a 10 mois
il y a 10 mois
il y a 10 mois
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 10 mois
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <!-- 安装激活-选择订单 -->
  2. <template>
  3. <empty-view :mode="config.emptyHint.mode" :content="config.emptyHint.hint" v-if="params.ordersList.length === 0" />
  4. <view class="list" v-else>
  5. <view class="item" v-for="(item,index) in params.ordersList" :key="index" :item="item">
  6. <view class="head">
  7. <view class="name">
  8. <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon"></image>
  9. <text class="title">{{item.productName ?item.productName: ''}}</text>
  10. </view>
  11. <view class="status text-orange">{{getOrderStatusName(item.orderStep)}}</view>
  12. </view>
  13. <view class="detail">
  14. <view class="orders">
  15. <view class="order-text">
  16. <text class="type">卡号:</text>
  17. <text class="value">{{item.cardId}}</text>
  18. </view>
  19. <view class="order-text">
  20. <text class="type">签号:</text>
  21. <text class="value">{{item.obuId}}</text>
  22. </view>
  23. <!-- <view class="order-text odd">
  24. <text class="type">业务类型:</text>
  25. <text class="value">{{getOrderTypeName(item.orderType)}}</text>
  26. </view> -->
  27. <view class="order-text odd">
  28. <text class="type">订单车牌号:</text>
  29. <text class="value">{{item.vehiclePlate}}</text>
  30. </view>
  31. <view class="order-text ">
  32. <text class="type">订单金额:</text>
  33. <text class="value">¥ {{item.amount / 100 ?item.amount / 100: '0.00'}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="btns">
  38. <view class="btn btn-primary as-gravity-center" @click="gotoConfirmReceipt(item)"
  39. v-if="item.status==2">确认收货</view>
  40. <view class="btn btn-primary as-gravity-center" @click="gotoActiveOrder(item)"
  41. v-if="item.status==1">去激活</view>
  42. <view class="btn btn-primary as-gravity-center" @click="gotoOnceActivate(item)"
  43. v-if="item.status==3">OBU重新激活</view>
  44. </view>
  45. </view>
  46. <uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt"
  47. v-if="params.ordersList.length > 0" />
  48. </view>
  49. </template>
  50. <script setup lang="ts">
  51. import { reactive, ref, watch } from "vue";
  52. import { request, requestNew } from "@/utils/network/request.js";
  53. import { stringToJson } from "@/utils/network/encryption";
  54. import { onLoad, onUnload, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app";
  55. import { getItem, StorageKeys,setItem } from "@/utils/storage";
  56. import { hasLogin, msg, getOrderStatusName, getOrderTypeName, navTo,interceptND } from "@/utils/utils";
  57. import { queryActiveInfo,ndActivateVerification,silentLoginApi} from "@/utils/network/api";
  58. import useOrderSkip from "@/composables/order/useOrderSkip";
  59. import { deviceType } from "@/utils/network/difference";
  60. import { jump } from "@/datas/9901Jump.js";
  61. //跳转
  62. const { gotoActiveOrder, gotoConfirmReceipt } = useOrderSkip();
  63. const gotoOnceActivate = (item) => {
  64. if (item.deviceType == deviceType) {
  65. const params = encodeURIComponent(JSON.stringify(item))
  66. jump("1", params)
  67. } else {
  68. let vehicleId=item.vehiclePlate+"_"+item.vehiclePlateColor
  69. interceptND(vehicleId).then(()=>{
  70. // #ifdef MP-WEIXIN
  71. navTo(
  72. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.vehicleId}`
  73. );
  74. // #endif
  75. // #ifdef MP-ALIPAY
  76. navTo(
  77. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?id=${item.vehicleId}`
  78. );
  79. // #endif
  80. })
  81. }
  82. }
  83. const config = {
  84. emptyHint: {
  85. hint: '~ 暂无待激活订单 ~',
  86. icon: '',
  87. mode: 'order'
  88. },
  89. contentTxt: {
  90. contentdown: '~上拉加载更多~',
  91. contentrefresh: '努力加载中...',
  92. contentnomore: '-- 我是有底线的 --'
  93. }
  94. }
  95. //请求参数
  96. const params = reactive({
  97. pageNo: 1,
  98. pageSize: 10,
  99. total: 0,
  100. status: 'more',
  101. reload: false,
  102. ordersList: [],
  103. vehicleId:"",
  104. tel:"",
  105. qdOrderNo:""
  106. })
  107. /* 刷新列表 */
  108. const refreshList = () => {
  109. params.pageNo = 1;
  110. params.total = 0;
  111. params.ordersList = [];
  112. params.status = 'more';
  113. params.reload = false;
  114. getList();
  115. }
  116. /* 加载更多 */
  117. const loadMore = () => {
  118. if (params.ordersList.length<params.pageNo*10) {
  119. params.status = 'noMore';
  120. } else {
  121. params.status = 'loading';
  122. params.pageNo++;
  123. getList();
  124. }
  125. }
  126. /* 获取列表数据 */
  127. const getList = async () => {
  128. if (!hasLogin()) {
  129. uni.stopPullDownRefresh();
  130. return;
  131. }
  132. let source = ""
  133. // #ifdef MP-ALIPAY
  134. source = "ALI"
  135. // #endif
  136. // #ifdef MP-WEIXIN
  137. source = "WECHAT"
  138. // #endif
  139. let res : any = null;
  140. const options = {
  141. type: 2,
  142. data: {
  143. "opId": getItem(StorageKeys.OpenId),
  144. "pageNo": params.pageNo,
  145. "pageSize": params.pageSize,
  146. },
  147. method: 'POST',
  148. showLoading: params.pageNo === 1 ? true : false,
  149. }
  150. try {
  151. res = await requestNew(queryActiveInfo, options);
  152. const data =res;
  153. console.log("data===",data)
  154. params.total = data.data;
  155. console.log("res====", params.total)
  156. if (data.activeList.length > 0 || data.receiveList.length > 0 || data.secondActiveList.length > 0) {
  157. // status 1 首次激活车辆信息列表 2确认收货车辆信息列表 3二次激活车辆信息列表
  158. var activeList=data.activeList
  159. var receiveList=data.receiveList
  160. var secondActiveList=data.secondActiveList
  161. if (data.activeList.length > 0){
  162. for(var i=0;i<activeList.length;i++){
  163. activeList[i]['status']=1
  164. }
  165. }
  166. if (data.receiveList.length > 0){
  167. for(var i=0;i<receiveList.length;i++){
  168. receiveList[i]['status']=2
  169. }
  170. }
  171. if (data.secondActiveList.length > 0){
  172. for(var i=0;i<secondActiveList.length;i++){
  173. secondActiveList[i]['status']=3
  174. }
  175. }
  176. const curList = [...activeList,...receiveList,...secondActiveList] || [];
  177. params.ordersList = params.reload ? curList : params.ordersList.concat(curList);
  178. params.reload = false;
  179. }
  180. if (params.total === params.ordersList.length) {
  181. params.reload = false;
  182. params.status = 'noMore';
  183. }
  184. if (params.pageNo === 1) {
  185. uni.stopPullDownRefresh();
  186. }
  187. console.log("params.ordersList", params.ordersList)
  188. } catch (e) {
  189. console.log('输出内容', e)
  190. uni.stopPullDownRefresh();
  191. }
  192. }
  193. onLoad((option) => {
  194. console.log("诺德激活",option)
  195. // 诺德数据过来 验证+无感登录
  196. if(option.qdOrderNo){
  197. params.qdOrderNo=option.qdOrderNo
  198. params.tel=option.tel
  199. params.vehicleId=option.vehicleId
  200. ndActivateVerificationQuery().then((data) => {
  201. if(data.pass=='on'){
  202. console.log("验证")
  203. silentLogin(data).then(() => {
  204. //监听订单刷新信息
  205. uni.$on('refreshOrder', (data) => {
  206. refreshList();
  207. });
  208. console.log("guoliale")
  209. refreshList();
  210. })
  211. }else{
  212. msg("不属于该渠道")
  213. }
  214. })
  215. }else{
  216. //监听订单刷新信息
  217. uni.$on('refreshOrder', (data) => {
  218. refreshList();
  219. });
  220. console.log("guoliale")
  221. refreshList();
  222. }
  223. });
  224. // 诺德激活验证接口
  225. const ndActivateVerificationQuery = () => {
  226. const options = {
  227. type: 2,
  228. data: {
  229. "code": "1", //诺德
  230. "qdOrderNo": params.qdOrderNo, //渠道订单号
  231. "tel": params.tel,
  232. "vehicleId": params.vehicleId,
  233. },
  234. method: "POST",
  235. showLoading: true,
  236. };
  237. return new Promise(async (resolve, reject) => {
  238. const res = await request(ndActivateVerification, options);
  239. const data = stringToJson(res.bizContent);
  240. console.log("data==", data)
  241. resolve(data);
  242. }).catch((error) => {
  243. reject(error);
  244. });
  245. }
  246. const silentLogin = (data) => {
  247. if (data.userType == "1") {
  248. var datas = {
  249. userType: data.userType,
  250. account: data.mobile,
  251. loginSource: getItem("loginSource"),
  252. };
  253. } else {
  254. var datas = {
  255. userType: data.userType,
  256. account: data.idNum,
  257. loginSource: getItem("loginSource"),
  258. };
  259. }
  260. console.log("datas",datas)
  261. const options = {
  262. type: 2,
  263. data: datas,
  264. method: "POST",
  265. showLoading: true,
  266. };
  267. return new Promise(async (resolve, reject) => {
  268. const res = await request(silentLoginApi, options);
  269. const data = stringToJson(res.bizContent);
  270. console.log("data===",data)
  271. setItem("openId", data.openId);
  272. setItem("token", data.accessToken);
  273. resolve(data);
  274. }).catch((error) => {
  275. reject(error);
  276. });
  277. }
  278. onUnload(() => {
  279. uni.$off('refreshOrder');
  280. });
  281. onPullDownRefresh(() => {
  282. refreshList();
  283. });
  284. onReachBottom(() => {
  285. loadMore();
  286. });
  287. </script>
  288. <style>
  289. page {
  290. background-color: #EEF7F7;
  291. }
  292. </style>
  293. <style lang="scss" scoped>
  294. .list {
  295. padding: 30rpx 30rpx 0rpx;
  296. display: flex;
  297. flex-direction: column;
  298. }
  299. .list .item {
  300. background: #ffffff;
  301. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  302. border-radius: 20rpx;
  303. box-sizing: border-box;
  304. display: flex;
  305. flex-direction: column;
  306. margin-bottom: 30rpx;
  307. }
  308. .list .item .head {
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. padding: 20rpx 28rpx;
  313. border-bottom: 1px solid #dcdcdc;
  314. }
  315. .list .item .head .icon {
  316. width: 48rpx;
  317. height: 48rpx;
  318. }
  319. .list .item .head .name {
  320. display: flex;
  321. align-items: center;
  322. }
  323. .list .text-green {
  324. font-size: 26rpx;
  325. color: #00b38b;
  326. }
  327. .list .text-orange {
  328. font-size: 26rpx;
  329. color: #ff8000;
  330. }
  331. .list .title {
  332. font-size: 30rpx;
  333. color: #333;
  334. }
  335. .list .detail {
  336. display: flex;
  337. justify-content: space-between;
  338. align-items: center;
  339. padding: 30rpx 32rpx;
  340. }
  341. .list .detail .type {
  342. font-size: 26rpx;
  343. color: #999;
  344. }
  345. .list .detail .value {
  346. font-size: 26rpx;
  347. color: #333;
  348. }
  349. .list .finished .detail .value {
  350. color: #999;
  351. }
  352. .list .detail .odd {
  353. margin: 20rpx 0;
  354. }
  355. .list .cny {
  356. font-size: 26rpx;
  357. color: #333;
  358. }
  359. .list .finished .cny {
  360. color: #999;
  361. }
  362. .list .amount {
  363. font-size: 40rpx;
  364. font-weight: bold;
  365. }
  366. .list .finished .amount {
  367. color: #999;
  368. }
  369. .list .btns {
  370. display: flex;
  371. align-items: center;
  372. justify-content: flex-end;
  373. border-top: 1px solid #dcdcdc;
  374. margin: 0 30rpx;
  375. padding: 20rpx 0;
  376. }
  377. .list .btn {
  378. height: 60rpx;
  379. // line-height: 60rpx;
  380. border-radius: 30rpx;
  381. padding: 0 24rpx;
  382. font-size: 26rpx;
  383. box-sizing: border-box;
  384. margin-right: 20rpx;
  385. }
  386. .list .btns .btn:last-child {
  387. margin: 0;
  388. }
  389. .list .btn-primary {
  390. border: 1px solid #00b38b;
  391. color: #00b38b;
  392. }
  393. .list .btn-normal {
  394. border: 1px solid #dcdcdc;
  395. color: #333;
  396. }
  397. </style>