detail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <view class="main">
  3. <view class="one"> <text>{{info.zhStatus}}</text> </view>
  4. <view class="two">
  5. <view class="two_1">
  6. <image v-if="info.source&&info.source.file.length>0" class="image"
  7. :src="info.source.file&&info.source.file.length>0?info.source.file[0].url:''">
  8. </image>
  9. <image v-else class="image" :src="config.logo_url&&config.logo_url.length>0?config.logo_url[0].url:''">
  10. </image>
  11. <text v-if="info.type=='0'">酒店民宿</text>
  12. <text v-else>景区门票</text>
  13. </view>
  14. <view class="two_2">
  15. <view class="left">
  16. <image v-if="info.source&&info.source.file.length>0" class="image"
  17. :src="info.source.file&&info.source.file.length>0?info.source.file[0].url:''">
  18. </image>
  19. <image v-else class="image"
  20. :src="config.logo_url&&config.logo_url.length>0?config.logo_url[0].url:''">
  21. </image>
  22. </view>
  23. <view class="right">
  24. <view class="right_1">
  25. <view class="left">
  26. <view class="name textOver">{{info.source_name||'暂无'}}</view>
  27. <view class="other">{{info.zhType||'暂无'}}</view>
  28. <view class="other">{{info.zhPerson||'暂无'}}</view>
  29. </view>
  30. <view class="right">
  31. <view class="other">
  32. ¥{{info.source.money||'0'}}
  33. </view>
  34. <view class="other">
  35. ×{{info.num||'0'}}
  36. </view>
  37. </view>
  38. </view>
  39. <view class="right_2">
  40. 合计:¥{{info.money||'0'}}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="thr">
  46. <view class="thr_1">优惠</view>
  47. <view class="other">商品总价:¥{{info.money||'0'}} <text>(共{{info.num||'0'}}件)</text> </view>
  48. <view class="other">优惠:¥{{info.coupon_money||'0'}}</view>
  49. <view class="other">实付:¥{{info.total_money||'0'}}</view>
  50. </view>
  51. <view class="four">
  52. <view class="four_1">订单信息</view>
  53. <view class="other">订单编号:{{info._id||'暂无'}}</view>
  54. <view class="other">下单时间:{{info.buy_time||'暂无'}}</view>
  55. </view>
  56. <view class="four">
  57. <view class="four_1">用户信息</view>
  58. <view class="list" v-for="(item, index) in info.identity" :key="index">
  59. <view class="other">游客{{index+1}}</view>
  60. <view class="other">真实姓名:{{item.name||'暂无'}}</view>
  61. <view class="other">证件号码:{{item.card||'暂无'}}</view>
  62. <view class="other">手机号码:{{ getProps(item.phone) }}</view>
  63. </view>
  64. </view>
  65. <view class="four">
  66. <view class="four_1">支付信息</view>
  67. <view class="other">支付时间:{{info.pay_time||'暂无'}}</view>
  68. <view class="other">交易快照:当发生交易纠纷时可作为交易凭证 ></view>
  69. <view class="other">支付数据:{{info.pay||'暂无'}}</view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. id: '',
  78. config: {
  79. logo_url: []
  80. },
  81. user: {},
  82. info: {
  83. source: {
  84. file: []
  85. }
  86. },
  87. statusList: [],
  88. personList: [],
  89. typeList: [],
  90. }
  91. },
  92. onLoad: async function(e) {
  93. const that = this;
  94. that.$set(that, `id`, e && e.id || '');
  95. that.searchConfig();
  96. that.searchToken();
  97. await that.searchOther();
  98. that.search();
  99. },
  100. methods: {
  101. searchConfig() {
  102. const that = this;
  103. try {
  104. const res = uni.getStorageSync('config');
  105. if (res) that.$set(that, `config`, res);
  106. } catch (e) {
  107. uni.showToast({
  108. title: err.errmsg,
  109. icon: 'error',
  110. duration: 2000
  111. });
  112. }
  113. },
  114. searchToken() {
  115. const that = this;
  116. try {
  117. const res = uni.getStorageSync('token');
  118. if (res) that.$set(that, `user`, res);
  119. } catch (e) {
  120. uni.showToast({
  121. title: err.errmsg,
  122. icon: 'error',
  123. duration: 2000
  124. });
  125. }
  126. },
  127. async search() {
  128. const that = this;
  129. if (that.id) {
  130. const res = await that.$api(`/order/${that.id}`, 'GET', {})
  131. if (res.errcode == '0') {
  132. const status = that.statusList.find(i => i.value == res.data.status)
  133. if (status) res.data.zhStatus = status.label
  134. if (res.data && res.data.source && res.data.source.person) {
  135. const person = that.personList.find(i => i.value == res.data.source.person)
  136. if (person) res.data.zhPerson = person.label
  137. }
  138. if (res.data && res.data.source && res.data.source.type) {
  139. const type = that.typeList.find(i => i.value == res.data.source.type)
  140. if (type) res.data.zhType = type.label
  141. }
  142. that.$set(that, `info`, res.data)
  143. } else {
  144. uni.showToast({
  145. title: res.errmsg,
  146. });
  147. }
  148. }
  149. },
  150. // 整理电话号
  151. getProps(phone) {
  152. if (!phone) return '暂无';
  153. return phone.replace(/^(\d{3})(\d{4})(\d{4})$/, '$1****$2');
  154. },
  155. // 查询其他信息
  156. async searchOther() {
  157. const that = this;
  158. let res;
  159. // 查询类型
  160. res = await that.$api(`/dictData`, 'GET', {
  161. type: 'order_status',
  162. is_use: '0',
  163. })
  164. if (res.errcode == '0') that.$set(that, `statusList`, res.data);
  165. // 出游人群
  166. res = await that.$api(`/dictData`, 'GET', {
  167. type: 'ticket_person',
  168. is_use: '0',
  169. })
  170. if (res.errcode == '0') that.$set(that, `personList`, res.data);
  171. // 服务特色
  172. res = await that.$api(`/dictData`, 'GET', {
  173. type: 'ticket_type',
  174. is_use: '0',
  175. })
  176. if (res.errcode == '0') that.$set(that, `typeList`, res.data);
  177. },
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. .main {
  183. display: flex;
  184. flex-direction: column;
  185. background-image: linear-gradient(to top, rgba(241, 241, 241, 1), rgba(135, 206, 250, 1), rgba(0, 122, 255, 1));
  186. .one {
  187. padding: 5vw;
  188. font-size: var(--font20Size);
  189. font-weight: bold;
  190. }
  191. .two {
  192. background-color: var(--mainColor);
  193. border-radius: 5px;
  194. margin: 2vw 2vw 0 2vw;
  195. padding: 2vw;
  196. .two_1 {
  197. display: flex;
  198. align-items: center;
  199. .image {
  200. width: 8vw;
  201. height: 8vw;
  202. border-radius: 8vw;
  203. }
  204. text {
  205. padding: 0 0 0 2vw;
  206. }
  207. }
  208. .two_2 {
  209. display: flex;
  210. justify-content: space-between;
  211. margin: 2vw 0 0 0;
  212. padding: 0 2vw;
  213. .left {
  214. width: 20vw;
  215. .image {
  216. width: 20vw;
  217. height: 20vw;
  218. border-radius: 1vw;
  219. }
  220. }
  221. .right {
  222. width: 65vw;
  223. margin: 0 0 0 2vw;
  224. .right_1 {
  225. display: flex;
  226. justify-content: space-between;
  227. .left {
  228. width: 55vw;
  229. .name {
  230. font-size: var(--font14Size);
  231. }
  232. .other {
  233. padding: 2px 0 0 0;
  234. font-size: var(--font12Size);
  235. color: var(--f85Color);
  236. }
  237. }
  238. .right {
  239. width: 10vw;
  240. text-align: right;
  241. .other {
  242. padding: 2px 0 0 0;
  243. font-size: var(--font12Size);
  244. color: var(--f85Color);
  245. }
  246. }
  247. }
  248. .right_2 {
  249. text-align: right;
  250. font-size: var(--font12Size);
  251. }
  252. }
  253. }
  254. }
  255. .thr {
  256. background-color: var(--mainColor);
  257. border-radius: 5px;
  258. margin: 2vw 2vw 0 2vw;
  259. padding: 2vw;
  260. .thr_1 {
  261. font-size: var(--font14Size);
  262. font-weight: bold;
  263. margin: 1vw 0;
  264. }
  265. .other {
  266. padding: 2px 0 0 0;
  267. font-size: var(--font12Size);
  268. color: var(--f85Color);
  269. }
  270. }
  271. .four {
  272. background-color: var(--mainColor);
  273. border-radius: 5px;
  274. margin: 2vw 2vw 0 2vw;
  275. padding: 2vw;
  276. .four_1 {
  277. font-size: var(--font14Size);
  278. font-weight: bold;
  279. margin: 1vw 0;
  280. }
  281. .list {
  282. border: 1px solid #d5d5da;
  283. border-radius: 5px;
  284. margin: 2vw 0 0 0;
  285. padding: 2vw;
  286. }
  287. .other {
  288. padding: 2px 0 0 0;
  289. font-size: var(--font12Size);
  290. color: var(--f85Color);
  291. }
  292. }
  293. }
  294. </style>