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.

253 lines
5.3 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="starting bx">
  3. <view class="bg">
  4. <image :src="appScroll || '@/static/starting/banner.png'" mode="widthFix"></image>
  5. </view>
  6. <view class="user-info">
  7. <view class="top">
  8. <view class="current-balance">{{ $t('page.starting.balance') }}</view>
  9. <view class="money">
  10. <view class="number">{{ userInfo.money }}</view>
  11. <view class="unit">{{ $store.state.unit }}</view>
  12. </view>
  13. </view>
  14. <view class="todoy-info">
  15. <view class="todoy-info-main">
  16. <!-- v-if="userInfo.isOpen == 'Y' && userInfo.orderNum == userInfo.encourageNum + 1" -->
  17. <!-- <view class="today-info-l">
  18. <view class="today-income">{{ $t('page.starting.today-income') }}</view>
  19. <div class="money">
  20. -
  21. <text class="number">{{ userInfo.belece }}</text>
  22. <text class="unit">{{ $store.state.unit }}</text>
  23. </div>
  24. </view> -->
  25. <div class="booking-info-r">
  26. <view class="booking-income">{{ $t('page.starting.completed') }}</view>
  27. <div class="booking-data">
  28. <text class="number">{{ userInfo.encourageNum }}/{{ userInfo.encourageSum }}</text>
  29. </div>
  30. </div>
  31. </view>
  32. </view>
  33. <view class="btn">
  34. <view @click="submit" class="submit">{{ $t('page.starting.auto-match') }}</view>
  35. </view>
  36. </view>
  37. <view class="steps">
  38. <!-- <view class="steps-title">The steps</view>
  39. <view class="steps-content">
  40. <view>1. Click the "Auto-match" button and follow the instructions to complete the task.</view>
  41. <view>2. After completing the task, you can settle the commission to the balance.</view>
  42. </view> -->
  43. <view class="steps-title">{{ $t('page.starting.steps-title') }}</view>
  44. <view class="steps-content" v-html="$t('page.starting.steps-content')"></view>
  45. </view>
  46. <sTabbar select="2" />
  47. <prizeDraw ref="prizeDraw" @orderPay="orderPay"></prizeDraw>
  48. </view>
  49. </template>
  50. <script>
  51. import sTabbar from '@/components/base/tabBar.vue'
  52. import prizeDraw from '@/components/prizeDraw/prizeDraw.vue'
  53. export default {
  54. name: 'Starting',
  55. components : { sTabbar , prizeDraw },
  56. data() {
  57. return {
  58. userInfo : {},
  59. appScroll : ''
  60. }
  61. },
  62. onShow(){
  63. this.getUserInfo()
  64. this.getAppScroll()
  65. },
  66. methods: {
  67. //点击抽奖按钮
  68. submit(){
  69. let self = this
  70. self.request('getRandomImage').then(a => {
  71. if(a.code == 200){
  72. self.request('createOrder', {}, {
  73. image : a.result.iamge,
  74. }).then(res => {
  75. if(res.code == 200){
  76. res.result.image = a.result.iamge
  77. self.$refs.prizeDraw.toggle(res.result)
  78. }
  79. })
  80. }
  81. })
  82. },
  83. //获取用户信息
  84. getUserInfo() {
  85. this.request('userInfo').then(res => {
  86. if (res.code == 200) {
  87. this.userInfo = res.result.userInfo
  88. }
  89. })
  90. },
  91. getAppScroll() {
  92. this.request('getAppScroll').then(res => {
  93. if (res.code == 200) {
  94. this.appScroll = res.result.title || res.result[0].title
  95. }
  96. })
  97. },
  98. //订单支付
  99. orderPay(id){
  100. this.request('pay',{},{ id }).then(res => {
  101. if (res.code == 200) {
  102. uni.showToast({
  103. icon: "none",
  104. title: this.$t(`message.${res.message}`)
  105. });
  106. this.getUserInfo()
  107. this.$refs.prizeDraw.close()
  108. }
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .starting {
  116. height: 100vh;
  117. padding-bottom: 300px;
  118. .bg {
  119. border-bottom-left-radius: 60% 60rpx;
  120. border-bottom-right-radius: 60% 60rpx;
  121. overflow: hidden;
  122. image {
  123. width: 100%;
  124. }
  125. }
  126. .user-info {
  127. position: relative;
  128. z-index: 1;
  129. width: 90%;
  130. margin: -120rpx auto 0rpx auto;
  131. background: white;
  132. border-radius: 20rpx;
  133. box-shadow: aqua 0.5px 0.5px 5px 0px;
  134. .top {
  135. box-sizing: border-box;
  136. padding: 0rpx 15rpx;
  137. .current-balance {
  138. display: flex;
  139. align-items: center;
  140. height: 60rpx;
  141. color: #8e8e98;
  142. font-size: 30rpx;
  143. }
  144. .money {
  145. display: flex;
  146. color: rgb(0, 208, 234);
  147. font-size: 50rpx;
  148. font-weight: bold;
  149. .number {}
  150. .unit {
  151. margin-left: 20rpx;
  152. }
  153. }
  154. }
  155. .todoy-info {
  156. box-sizing: border-box;
  157. padding: 0rpx 20rpx;
  158. height: 140rpx;
  159. .todoy-info-main {
  160. display: flex;
  161. flex-wrap: wrap;
  162. height: 100%;
  163. background-color: rgba(0, 208, 234, 0.1);
  164. border-radius: 20rpx;
  165. margin: 20rpx 0rpx;
  166. box-sizing: border-box;
  167. padding: 0rpx 30rpx;
  168. .today-info-l,
  169. .booking-info-r {
  170. display: flex;
  171. flex-direction: column;
  172. justify-content: center;
  173. width: 50%;
  174. font-size: 28rpx;
  175. .today-income,
  176. .booking-income {
  177. // color: #8e8e98;
  178. }
  179. .money,
  180. .booking-data {
  181. font-weight: bold;
  182. margin-top: 10rpx;
  183. }
  184. }
  185. }
  186. }
  187. .btn {
  188. padding: 20rpx;
  189. .submit {
  190. background-color: rgb(0, 208, 234);
  191. color: white;
  192. padding: 20rpx 0;
  193. text-align: center;
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. font-size: 40rpx;
  198. font-weight: bold;
  199. border-radius: 20rpx;
  200. }
  201. }
  202. }
  203. .steps {
  204. width: 90%;
  205. margin: 0rpx auto;
  206. padding-top: 80rpx;
  207. .steps-title {
  208. font-size: 36rpx;
  209. font-weight: bold;
  210. }
  211. .steps-content {
  212. color: #8e8e98;
  213. font-size: 30rpx;
  214. margin-top: 20rpx;
  215. }
  216. }
  217. }
  218. </style>