推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
6.7 KiB

6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
5 months ago
4 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
  1. <template>
  2. <view class="orderDetails">
  3. <Navbar :title="$t('pages_order.order_details.title')" :autoBack="true" :bgColor="bgColor" leftIconSize="18px" height="100rpx"
  4. :leftIconColor="leftIconColor" :titleStyle="{color:fontColor}" /><!-- 订单详情 -->
  5. <view class="content">
  6. <view class="baseInfo cardBackground_">
  7. <view class="statusBox">
  8. <i></i>
  9. <view class="status">{{orderStatus}}</view>
  10. </view>
  11. <view class="info grayBg cardStyle_">
  12. <view class="left">
  13. <image :src="images" />
  14. </view>
  15. <view class="right">
  16. <view class="detailed">
  17. <view class="title">{{getTitle()}}</view>
  18. <view class="date">{{dataInfo.startTime}}</view>
  19. <view class="address">{{getAddress()}}</view>
  20. </view>
  21. <view class="price"><text>{{$t('pages_order.order_details.total')}}</text>¥{{dataInfo.payPrice}}</view><!-- 总计 -->
  22. </view>
  23. </view>
  24. </view>
  25. <view class="orderInfo">
  26. <view class="title">{{$t('pages_order.order_details.order_info')}}</view><!-- 订单信息 -->
  27. <view class="details">
  28. <uv-cell :border="false" titleStyle="{color: 'red'}" :title="$t('pages_order.order_details.order_number')" :value="showOrderId"></uv-cell><!-- -->
  29. <uv-cell :border="false" titleStyle="{color: 'red'}" :title="$t('pages_order.order_details.order_time')" :value="dataInfo.createTime"></uv-cell><!-- -->
  30. <uv-cell :border="false" titleStyle="{color: 'red'}" :title="$t('pages_order.order_details.order_amount')" :value="'¥' + dataInfo.payPrice"></uv-cell><!-- -->
  31. <uv-cell :border="false" titleStyle="{color: 'red'}" :title="$t('pages_order.order_details.order_status')" :value="orderStatus"></uv-cell><!-- -->
  32. </view>
  33. </view>
  34. <view class="tips">
  35. <view class="title">{{$t('pages_order.order_details.payment_notice')}}</view><!-- 支付须知 -->
  36. <view class="details">
  37. <uv-parse :content="configList.recharge_instructions"></uv-parse>
  38. </view>
  39. </view>
  40. <view class="tips" v-if="dataInfo.type == 0">
  41. <view class="title">{{$t('pages_order.order_details.activity_notice')}}</view><!-- 活动须知 -->
  42. <view class="details">
  43. <uv-parse :content="getHuodongText()"></uv-parse>
  44. <!-- <uv-parse :content="configList.huodong_text"></uv-parse> -->
  45. </view>
  46. </view>
  47. <view class="tips" v-else-if="dataInfo.type == 1">
  48. <view class="title">{{$t('pages_order.order_details.travel_notice')}}</view><!-- 旅行须知 -->
  49. <view class="details">
  50. <uv-parse :content="getLvyouText()"></uv-parse>
  51. <!-- <uv-parse :content="configList.withdrawal_instructions"></uv-parse> -->
  52. </view>
  53. </view>
  54. </view>
  55. <view style="padding: 65rpx 35rpx;"
  56. @click="open"
  57. v-if="dataInfo.state == 1">
  58. <uv-button :custom-style="customStyle" type="primary" shape="circle" color="#381615" :text="$t('pages_order.order_details.activity_checkin')"></uv-button><!-- -->
  59. </view>
  60. <signInQrcodePopup ref="signInQrcodePopup"/>
  61. </view>
  62. </template>
  63. <script>
  64. import Navbar from '@/pages/components/Navbar.vue'
  65. import signInQrcodePopup from '@/components/cart/signInQrcodePopup.vue'
  66. import {
  67. globalMixin
  68. } from '../pages/mixins/globalMixin';
  69. export default {
  70. mixins: [globalMixin],
  71. components: {
  72. Navbar,
  73. signInQrcodePopup,
  74. },
  75. data() {
  76. return {
  77. orderId:'',
  78. dataInfo: {},
  79. customStyle:{
  80. color:'#FF5858'
  81. },
  82. detail : {},
  83. }
  84. },
  85. onLoad(e) {
  86. this.orderId = e.id
  87. this.getorderInfo()
  88. },
  89. computed:{
  90. orderStatus() {
  91. let state = this.dataInfo.state
  92. if( state == 0) {
  93. return this.$t('pages_order.order_details.status.unpaid') // 未付款
  94. }else if(state == 1) {
  95. return this.$t('pages_order.order_details.status.pending') // 待参加
  96. }else if(state == 2) {
  97. return this.$t('pages_order.order_details.status.completed') // 已完成
  98. }else{
  99. return this.$t('pages_order.order_details.status.cancelled') // 已取消
  100. }
  101. },
  102. showOrderId() {//0活动 1旅行
  103. let id = ""
  104. if(this.dataInfo.type == 0) {
  105. id = this.dataInfo.activityOrderId
  106. }else{
  107. id = this.dataInfo.travelOrderId
  108. }
  109. return id
  110. },
  111. images(){
  112. return this.dataInfo.image && this.dataInfo.image.split(',')[0]
  113. },
  114. },
  115. methods:{
  116. getorderInfo() {
  117. this.$api('orderInfo',{orderId:this.orderId},res=>{
  118. if(res.code == 200) {
  119. this.dataInfo = res.result.orderDetails
  120. this.detail = res.result
  121. }
  122. })
  123. },
  124. open(){
  125. this.$refs.signInQrcodePopup.open(this.orderId)
  126. },
  127. getTitle() {
  128. // 根据订单类型决定使用哪种对象类型进行国际化
  129. if (this.dataInfo.type == 0) {
  130. // 活动订单
  131. return this.$ot(this.detail.activity, 'active', 'title')
  132. } else {
  133. // 旅行订单
  134. return this.$ot(this.detail.travel, 'travel', 'title')
  135. }
  136. },
  137. getAddress() {
  138. // 根据订单类型决定使用哪种对象类型进行国际化
  139. if (this.dataInfo.type == 0) {
  140. // 活动订单
  141. return this.$ot(this.detail.activity, 'active', 'address')
  142. } else {
  143. // 旅行订单
  144. return this.$ot(this.detail.travel, 'travel', 'address')
  145. }
  146. },
  147. getHuodongText() {
  148. return this.$ot(this.detail.activity, 'active', 'orderDetails')
  149. },
  150. getLvyouText() {
  151. return this.$ot(this.detail.travel, 'travel', 'xz')
  152. },
  153. }
  154. }
  155. </script>
  156. <style scoped lang="scss">
  157. .orderDetails {
  158. padding-bottom: 80rpx;
  159. }
  160. .details {
  161. padding: 50rpx 40rpx;
  162. /deep/.uv-cell {
  163. .uv-cell__body {
  164. padding: 0rpx;
  165. padding-bottom: 30rpx;
  166. }
  167. &:last-child {
  168. .uv-cell__body {
  169. padding-bottom: 0rpx;
  170. }
  171. }
  172. .uv-cell__body__content {
  173. .uv-cell__title-text {
  174. color: $uni-text-color-grey !important;
  175. font-size: 28rpx
  176. }
  177. }
  178. .uv-cell__value {
  179. color: #DCDCDC !important;
  180. font-size: 28rpx
  181. }
  182. }
  183. }
  184. .orderDetails {
  185. margin-top: 40rpx;
  186. /deep/.uv-navbar__content__title {
  187. color: #fff;
  188. }
  189. .content {
  190. padding: 0 35rpx;
  191. color: #fff;
  192. padding-top: calc(var(--status-bar-height) + 110rpx);
  193. .baseInfo {
  194. .statusBox {
  195. display: flex;
  196. align-items: center;
  197. padding: 33rpx 47rpx 24rpx;
  198. i {
  199. background: url('@/static/image/cart/U-status.png') no-repeat;
  200. background-size: 100% 100%;
  201. display: block;
  202. width: 39rpx;
  203. height: 34rpx;
  204. margin-right: 15rpx;
  205. }
  206. .status {
  207. font-size: 32rpx;
  208. }
  209. }
  210. }
  211. .orderInfo,
  212. .tips {
  213. .title {
  214. font-size: 29rpx;
  215. padding-bottom: 26rpx;
  216. margin-top: 36rpx;
  217. }
  218. .details {
  219. background-color: $uni-color-card-background;
  220. border-radius: 26rpx;
  221. }
  222. }
  223. .tips {
  224. .details {
  225. p {
  226. color: #CCC;
  227. font-size: 25rpx;
  228. line-height: 50rpx;
  229. }
  230. }
  231. }
  232. }
  233. }
  234. </style>