detail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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.discount||'0'}}</view>
  49. <view class="other">实付 ¥{{info.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. no: {
  84. source: {
  85. file: []
  86. }
  87. }
  88. },
  89. statusList: [],
  90. personList: [],
  91. typeList: [],
  92. }
  93. },
  94. onLoad: async function(e) {
  95. const that = this;
  96. that.$set(that, `id`, e && e.id || '');
  97. that.searchConfig();
  98. that.searchToken();
  99. await that.searchOther();
  100. that.search();
  101. },
  102. methods: {
  103. searchConfig() {
  104. const that = this;
  105. try {
  106. const res = uni.getStorageSync('config');
  107. if (res) that.$set(that, `config`, res);
  108. } catch (e) {
  109. uni.showToast({
  110. title: err.errmsg,
  111. icon: 'error',
  112. duration: 2000
  113. });
  114. }
  115. },
  116. searchToken() {
  117. const that = this;
  118. try {
  119. const res = uni.getStorageSync('token');
  120. if (res) that.$set(that, `user`, res);
  121. } catch (e) {
  122. uni.showToast({
  123. title: err.errmsg,
  124. icon: 'error',
  125. duration: 2000
  126. });
  127. }
  128. },
  129. async search() {
  130. const that = this;
  131. if (that.id) {
  132. const res = await that.$api(`/order/${that.id}`, 'GET', {})
  133. if (res.errcode == '0') {
  134. const status = that.statusList.find(i => i.value == res.data.status)
  135. if (status) res.data.zhStatus = status.label
  136. if (res.data && res.data.source && res.data.source.person) {
  137. const person = that.personList.find(i => i.value == res.data.source.person)
  138. if (person) res.data.zhPerson = person.label
  139. }
  140. if (res.data && res.data.source && res.data.source.type) {
  141. const type = that.typeList.find(i => i.value == res.data.source.type)
  142. if (type) res.data.zhType = type.label
  143. }
  144. that.$set(that, `info`, res.data)
  145. } else {
  146. uni.showToast({
  147. title: res.errmsg,
  148. });
  149. }
  150. }
  151. },
  152. // 整理电话号
  153. getProps(phone) {
  154. if (!phone) return '暂无';
  155. return phone.replace(/^(\d{3})(\d{4})(\d{4})$/, '$1****$2');
  156. },
  157. // 查询其他信息
  158. async searchOther() {
  159. const that = this;
  160. let res;
  161. // 查询类型
  162. res = await that.$api(`/dictData`, 'GET', {
  163. type: 'order_status',
  164. is_use: '0',
  165. })
  166. if (res.errcode == '0') that.$set(that, `statusList`, res.data);
  167. // 出游人群
  168. res = await that.$api(`/dictData`, 'GET', {
  169. type: 'ticket_person',
  170. is_use: '0',
  171. })
  172. if (res.errcode == '0') that.$set(that, `personList`, res.data);
  173. // 服务特色
  174. res = await that.$api(`/dictData`, 'GET', {
  175. type: 'ticket_type',
  176. is_use: '0',
  177. })
  178. if (res.errcode == '0') that.$set(that, `typeList`, res.data);
  179. },
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .main {
  185. display: flex;
  186. flex-direction: column;
  187. background-image: linear-gradient(to top, rgba(241, 241, 241, 1), rgba(135, 206, 250, 1), rgba(0, 122, 255, 1));
  188. .one {
  189. padding: 5vw;
  190. font-size: var(--font20Size);
  191. font-weight: bold;
  192. }
  193. .two {
  194. background-color: var(--mainColor);
  195. border-radius: 5px;
  196. margin: 2vw 2vw 0 2vw;
  197. padding: 2vw;
  198. .two_1 {
  199. display: flex;
  200. align-items: center;
  201. .image {
  202. width: 8vw;
  203. height: 8vw;
  204. border-radius: 8vw;
  205. }
  206. text {
  207. padding: 0 0 0 2vw;
  208. }
  209. }
  210. .two_2 {
  211. display: flex;
  212. justify-content: space-between;
  213. margin: 2vw 0 0 0;
  214. padding: 0 2vw;
  215. .left {
  216. width: 20vw;
  217. .image {
  218. width: 20vw;
  219. height: 20vw;
  220. border-radius: 1vw;
  221. }
  222. }
  223. .right {
  224. width: 65vw;
  225. margin: 0 0 0 2vw;
  226. .right_1 {
  227. display: flex;
  228. justify-content: space-between;
  229. .left {
  230. width: 55vw;
  231. .name {
  232. font-size: var(--font14Size);
  233. }
  234. .other {
  235. padding: 2px 0 0 0;
  236. font-size: var(--font12Size);
  237. color: var(--f85Color);
  238. }
  239. }
  240. .right {
  241. width: 10vw;
  242. text-align: right;
  243. .other {
  244. padding: 2px 0 0 0;
  245. font-size: var(--font12Size);
  246. color: var(--f85Color);
  247. }
  248. }
  249. }
  250. .right_2 {
  251. text-align: right;
  252. font-size: var(--font12Size);
  253. }
  254. }
  255. }
  256. }
  257. .thr {
  258. background-color: var(--mainColor);
  259. border-radius: 5px;
  260. margin: 2vw 2vw 0 2vw;
  261. padding: 2vw;
  262. .thr_1 {
  263. font-size: var(--font14Size);
  264. font-weight: bold;
  265. margin: 1vw 0;
  266. }
  267. .other {
  268. padding: 2px 0 0 0;
  269. font-size: var(--font12Size);
  270. color: var(--f85Color);
  271. }
  272. }
  273. .four {
  274. background-color: var(--mainColor);
  275. border-radius: 5px;
  276. margin: 2vw 2vw 0 2vw;
  277. padding: 2vw;
  278. .four_1 {
  279. font-size: var(--font14Size);
  280. font-weight: bold;
  281. margin: 1vw 0;
  282. }
  283. .list {
  284. border: 1px solid #d5d5da;
  285. border-radius: 5px;
  286. margin: 2vw 0 0 0;
  287. padding: 2vw;
  288. }
  289. .other {
  290. padding: 2px 0 0 0;
  291. font-size: var(--font12Size);
  292. color: var(--f85Color);
  293. }
  294. }
  295. }
  296. </style>