detail.vue 7.5 KB

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