service-oil.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <view class="service-oil">
  3. <view class="bar-list">
  4. <view v-for="test in tests" :key="test.id" class="bar">
  5. <image :src="test.icon" mode="" @click="processById(test.id)" />
  6. <view class="text">{{ test.name }}</view>
  7. </view>
  8. </view>
  9. <view class="mid">
  10. <view class="card">
  11. <image src="../../../static/index/convenient-services/card.png" mode="" />
  12. <view v-if="showyouka" class="number">
  13. 油卡编号: <text>{{ youkabianhao }}</text>
  14. <view class="copy" @tap="copyText(youkabianhao)">复制</view>
  15. </view>
  16. <view v-if="showyouka" class="surplus">油卡余额: <text>{{ youkayue }}</text></view>
  17. </view>
  18. <view v-for="test in czlog" :key="test.id" class="order-form">
  19. <view class="order-number">订单号: <text>{{ test.orderno }}</text></view>
  20. <view class="copy1" @tap="copyText(test.orderno)">复制</view>
  21. <view class="money">金额: <text>{{ test.amount }}</text></view>
  22. <view class="status">状态: <text>{{ test.status ? '失败' : '成功' }}</text></view>
  23. <view class="list">
  24. <view class="left"></view>
  25. <view class="heng"></view>
  26. <view class="right"></view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import { tests, tests1 } from './data'
  34. import { MainRequest } from '../../../utils'
  35. export default {
  36. name: 'PhoneBill',
  37. props: {
  38. },
  39. data() {
  40. return {
  41. tests,
  42. tests1,
  43. showyouka: false,
  44. youkabianhao: '',
  45. youkayue: 0,
  46. czlog: []
  47. }
  48. },
  49. created() {
  50. MainRequest('/tuanyou/queryYouKaAmount', null, 'post').then(({ data }) => {
  51. // console.log(data)
  52. if (data.youKa != null) {
  53. this.showyouka = true
  54. this.youkabianhao = data.youKa
  55. this.youkayue = data.accountBalance
  56. this.tests = this.tests1
  57. const reqData = {
  58. 'page': 1,
  59. 'limit': 50
  60. }
  61. MainRequest('/tuanyou/userczlog', reqData, 'post').then(({ data }) => {
  62. console.log(data)
  63. if (data.items != null) {
  64. this.czlog = data.items
  65. }
  66. })
  67. }
  68. })
  69. },
  70. methods: {
  71. back() {
  72. uni.navigateBack()
  73. // uni.navigateTo({ url: '/pages_user/serve/tuanyou/convenient-services' })
  74. },
  75. copyText(value) {
  76. uni.setClipboardData({
  77. data: value,
  78. success() {
  79. console.log('success', value)
  80. }
  81. })
  82. },
  83. processById(id) {
  84. if (id == 1) {
  85. MainRequest('/tuanyou/createyouka', null, 'post').then(({ data }) => {
  86. // console.log(data)
  87. MainRequest('/tuanyou/queryYouKaAmount', null, 'post').then(({ data }) => {
  88. // console.log(data)
  89. if (data.youKa != null) {
  90. this.showyouka = true
  91. this.youkabianhao = data.youKa
  92. this.youkayue = data.accountBalance
  93. this.tests = this.tests1
  94. }
  95. })
  96. })
  97. } else if (id == 2) {
  98. uni.navigateTo({
  99. url: '/pages_user/serve/tuanyou/recharge?kahao=' + this.youkabianhao
  100. })
  101. } else if (id == 3) {
  102. MainRequest('/tuanyou/getjumpurl', null, 'post').then(({ data }) => {
  103. // console.log(data)
  104. // uni.navigateToMiniProgram({
  105. // appId: 'wx1f1ea04b716771be',
  106. // path: data,
  107. // // extraData: {
  108. // // 'data1': 'test'
  109. // // },
  110. // success(res) {
  111. // console.log(res);
  112. // },
  113. // fail(res) {
  114. // console.log(res);
  115. // }
  116. // })
  117. uni.navigateTo({
  118. url: '/pages_user/serve/tuanyou/tuanyouh5?url=' + data
  119. })
  120. })
  121. }
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="less" scoped>
  127. .service-oil {
  128. width: 100%;
  129. min-height: 100vh;
  130. padding: 0 30upx;
  131. box-sizing: border-box;
  132. background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 10%);
  133. .header {
  134. width: 100%;
  135. display: flex;
  136. align-items: center;
  137. /deep/ .bee-address-container {
  138. flex: 1;
  139. }
  140. .address-wrapper {
  141. flex: 1;
  142. display: flex;
  143. align-items: center;
  144. justify-content: space-between;
  145. .current-addresss {
  146. font-size: 32upx;
  147. font-weight: 500;
  148. }
  149. }
  150. }
  151. .top {
  152. width: 100%;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. padding-top: 36upx;
  157. image {
  158. width: 56upx;
  159. height: 56upx;
  160. position: absolute;
  161. left: 30upx;
  162. }
  163. text {
  164. color: rgba(0, 0, 0, 0.85);
  165. font-size: 36upx;
  166. font-weight: 500;
  167. }
  168. }
  169. .banner-wrapper {
  170. padding: 28upx 0;
  171. image {
  172. width: 100%;
  173. height: 200upx;
  174. border-radius: 20upx;
  175. }
  176. }
  177. .bar-list {
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. padding: 44upx 80upx 68upx 80upx;
  182. .bar {
  183. width: 112upx;
  184. display: flex;
  185. flex-direction: column;
  186. align-items: center;
  187. image {
  188. width: 64upx;
  189. height: 64upx;
  190. }
  191. .text {
  192. font-size: 28upx;
  193. color: #000000;
  194. }
  195. }
  196. }
  197. .mid {
  198. // padding: 0upx 22upx;
  199. // border-radius: 20upx 20upx 0upx 0upx;
  200. // background: linear-gradient(180deg, #FFFFFF 0%, #FDFAFA 122%);
  201. .card {
  202. background: #FFFFFF;
  203. border-radius: 10upx;
  204. padding: 108upx 0upx 40upx 30upx;
  205. position: relative;
  206. margin-bottom: 26upx;
  207. image {
  208. width: 302upx;
  209. height: 100upx;
  210. position: absolute;
  211. top: 0upx;
  212. left: 0upx;
  213. }
  214. .number {
  215. padding-bottom: 10upx;
  216. font-size: 28upx;
  217. font-weight: 500;
  218. color: #000000;
  219. display: flex;
  220. align-items: center;
  221. text {
  222. padding-left: 10upx;
  223. color: #3D3D3D;
  224. }
  225. .copy {
  226. position: absolute;
  227. right: 30upx;
  228. }
  229. }
  230. .surplus {
  231. font-size: 28upx;
  232. font-weight: 500;
  233. color: #000000;
  234. text {
  235. padding-left: 10upx;
  236. color: #FF0000;
  237. }
  238. }
  239. }
  240. .order-form {
  241. margin-bottom: 26upx;
  242. background: #FFFFFF;
  243. border-radius: 10upx;
  244. padding: 40upx 30upx 26upx 30upx;
  245. box-sizing: border-box;
  246. position: relative;
  247. .order-number {
  248. display: flex;
  249. justify-content: space-between;
  250. align-items: center;
  251. color: #000000;
  252. text {}
  253. }
  254. .copy1{
  255. color: #000000;
  256. text-align: right;
  257. }
  258. .money {
  259. padding-top: 80upx;
  260. padding-bottom: 28upx;
  261. color: #000000;
  262. display: flex;
  263. justify-content: space-between;
  264. align-items: center;
  265. text {
  266. color: #FF0000;
  267. }
  268. }
  269. .status {
  270. color: #000000;
  271. display: flex;
  272. justify-content: space-between;
  273. align-items: center;
  274. text {
  275. color: #3662EC;
  276. }
  277. }
  278. .list {
  279. display: flex;
  280. align-items: center;
  281. position: absolute;
  282. top: 150upx;
  283. left: 0;
  284. width: 100%;
  285. .left {
  286. width: 46upx;
  287. height: 46upx;
  288. border-radius: 40upx;
  289. background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 10%);
  290. position: absolute;
  291. left: -26upx;
  292. }
  293. .heng {
  294. width: 100%;
  295. height: 0upx;
  296. border: 1upx dashed #D8D8D8;
  297. }
  298. .right {
  299. width: 46upx;
  300. height: 46upx;
  301. border-radius: 40upx;
  302. background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 10%);
  303. position: absolute;
  304. right: -26upx;
  305. }
  306. }
  307. }
  308. }
  309. }
  310. </style>