settlementCode.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view class="container">
  3. <!-- Tab切换 - 平均分配宽度 -->
  4. <view class="custom-tabs">
  5. <view class="tab-item" :class="{ active: currentTab === 0 }" @click="switchTab(0)">
  6. <text class="tab-text">京东月结码</text>
  7. </view>
  8. <view class="tab-item" :class="{ active: currentTab === 1 }" @click="switchTab(1)">
  9. <text class="tab-text">顺丰月结码</text>
  10. </view>
  11. </view>
  12. <!-- 二维码邀请内容 -->
  13. <view class="tab-content">
  14. <!-- 店铺信息 -->
  15. <view class="store-info">
  16. <view class="store-name">月结卡号</view>
  17. <view class="store">
  18. <text class="store-address">12345444</text>
  19. <!-- <u-icon name="arrow-right"></u-icon> -->
  20. </view>
  21. </view>
  22. <!-- 二维码区域 -->
  23. <view class="qrcode-container">
  24. <view class="store-manager-content">
  25. <text class="store-manager title">请小哥扫此二维码</text>
  26. </view>
  27. <view class="store-manager-content">
  28. <text class="store-manager">警告:系统将记录所有操作,请勿违规使用</text>
  29. </view>
  30. <!-- 空出二维码位置 -->
  31. <view class="qrcode-placeholder">
  32. <!-- 这里在实际应用中会显示二维码图片 -->
  33. <image :src="qrCodeUrl"></image>
  34. </view>
  35. <view class="expiry-info" @click="getCode">
  36. <text class="text">此二维码300秒有效,点击</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup>
  43. import {
  44. ref
  45. } from 'vue'
  46. import {
  47. onLoad,
  48. onShow
  49. } from '@dcloudio/uni-app' // 导入 UniApp 的生命周期
  50. import {getQrcode} from '@/api/mine.js'
  51. // 当前选中的tab
  52. const currentTab = ref(0)
  53. const qrCodeUrl = ref('')
  54. onLoad(() => {
  55. getCode()
  56. })
  57. onShow(() => {
  58. })
  59. // 获取月结码
  60. const getCode = async () =>{
  61. let res = await getQrcode({source:1});
  62. console.log(res.data.qrCodeImage)
  63. qrCodeUrl.value = res.data.qrCodeImage;
  64. }
  65. // 切换Tab
  66. const switchTab = (index) => {
  67. currentTab.value = index
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .header {
  72. padding: 44rpx 0 30rpx 0;
  73. text-align: center;
  74. background-color: #fff;
  75. border-bottom: 1rpx solid #eee;
  76. .header-title {
  77. font-size: 36rpx;
  78. font-weight: bold;
  79. color: #333;
  80. }
  81. }
  82. // 自定义Tab布局 - 平均分配
  83. .custom-tabs {
  84. display: flex;
  85. background-color: #fff;
  86. border-bottom: 1rpx solid #eee;
  87. }
  88. .tab-item {
  89. flex: 1;
  90. text-align: center;
  91. padding: 30rpx 0;
  92. position: relative;
  93. &.active {
  94. .tab-text {
  95. color: #2979ff;
  96. font-weight: bold;
  97. }
  98. &::after {
  99. content: '';
  100. position: absolute;
  101. bottom: 0;
  102. left: 50%;
  103. transform: translateX(-50%);
  104. width: 80rpx;
  105. height: 4rpx;
  106. background-color: #2979ff;
  107. border-radius: 2rpx;
  108. }
  109. }
  110. .tab-text {
  111. font-size: 32rpx;
  112. color: #666;
  113. }
  114. }
  115. // 内容区域
  116. .tab-content {
  117. padding: 20rpx;
  118. }
  119. // 店铺信息
  120. .store-info {
  121. height: 108rpx;
  122. background: #FFFFFF;
  123. border-radius: 32rpx;
  124. margin-bottom: 20rpx;
  125. padding: 0 32rpx;
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. .store-icon {
  130. width: 80rpx;
  131. height: 80rpx;
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. background: rgba(0, 137, 255, 0.1);
  136. border-radius: 16rpx 16rpx 16rpx 16rpx;
  137. flex-shrink: 0;
  138. image {
  139. width: 48rpx;
  140. height: 48rpx;
  141. }
  142. }
  143. .store {
  144. display: flex;
  145. .store-name {
  146. height: 44rpx;
  147. font-weight: 400;
  148. font-size: 28rpx;
  149. color: #333333;
  150. line-height: 44rpx;
  151. text-align: left;
  152. }
  153. .store-address {
  154. min-height: 44rpx;
  155. line-height: 44rpx;
  156. font-size: 28rpx;
  157. color: #1B64F0;
  158. text-align: left;
  159. }
  160. }
  161. }
  162. // 二维码区域
  163. .qrcode-container {
  164. background-color: #fff;
  165. border-radius: 32rpx;
  166. padding: 20rpx;
  167. text-align: center;
  168. .store-manager-content {
  169. display: flex;
  170. justify-content: center;
  171. text-align: center;
  172. image {
  173. width: 48rpx;
  174. height: 48rpx;
  175. border-radius: 48rpx;
  176. }
  177. .store-manager {
  178. height: 44rpx;
  179. font-weight: 400;
  180. font-size: 28rpx;
  181. color: #666666;
  182. line-height: 44rpx;
  183. &.title {
  184. height: 48rpx;
  185. font-weight: bold;
  186. font-size: 32rpx;
  187. color: #333333;
  188. line-height: 48rpx;
  189. }
  190. }
  191. }
  192. // 二维码占位区域
  193. .qrcode-placeholder {
  194. width: 400rpx;
  195. height: 400rpx;
  196. margin: 20rpx auto 30rpx;
  197. border-radius: 16rpx;
  198. background-color: #f5f5f5;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. /* 这里在实际应用中会显示二维码图片 */
  203. /* 暂时使用背景色占位 */
  204. image {
  205. width: 400rpx;
  206. height: 400rpx;
  207. border-radius: 16rpx;
  208. }
  209. }
  210. .expiry-info {
  211. margin: 20rpx;
  212. height: 84rpx;
  213. background: #F5F7FA;
  214. border-radius: 16rpx;
  215. font-weight: 400;
  216. font-size: 28rpx;
  217. color: #3D3D3D;
  218. line-height: 84rpx;
  219. text-align: center;
  220. .text{
  221. &::after{
  222. content: '刷新二维码';
  223. color: #1B64F0;
  224. }
  225. }
  226. }
  227. }
  228. // 按钮组
  229. .button-group {
  230. width: 100%;
  231. height: 132rpx;
  232. display: flex;
  233. justify-content: space-around;
  234. align-items: center;
  235. position: fixed;
  236. bottom: 0;
  237. padding: 0rpx 32rpx;
  238. background-color: #fff;
  239. .button {
  240. height: 88rpx;
  241. line-height: 88rpx;
  242. flex: 1;
  243. text-align: center;
  244. border-radius: 16rpx;
  245. font-size: 30rpx;
  246. font-weight: bold;
  247. &.share-button {
  248. color: #1B64F0;
  249. margin-right: 32rpx;
  250. background: rgba(0, 137, 255, 0.1);
  251. }
  252. &.save-button {
  253. background-color: #1B64F0;
  254. color: #fff;
  255. }
  256. .button-text {
  257. font-size: 30rpx;
  258. }
  259. }
  260. }
  261. // 手机号邀请表单
  262. .phone-form {
  263. background-color: #fff;
  264. border-radius: 16rpx;
  265. padding: 16rpx;
  266. .phone-title {
  267. font-size: 32rpx;
  268. font-weight: bold;
  269. color: #333;
  270. margin-bottom: 16rpx;
  271. display: block;
  272. }
  273. .phone-input-group {
  274. height: 88rpx;
  275. display: flex;
  276. border-radius: 16rpx;
  277. overflow: hidden;
  278. background-color: #F5F7FA;
  279. .country-code {
  280. width: 140rpx;
  281. padding: 24rpx;
  282. text-align: center;
  283. font-size: 28rpx;
  284. color: #333;
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. border-right: 2rpx solid #e0e0e0;
  289. }
  290. .phone-input {
  291. height: 88rpx;
  292. line-height: 88rpx;
  293. flex: 1;
  294. padding: 24rpx;
  295. font-size: 28rpx;
  296. }
  297. }
  298. }
  299. .employee-item-main {
  300. display: flex;
  301. align-items: center;
  302. margin-top: 20rpx;
  303. background-color: #fff;
  304. border-radius: 32rpx;
  305. padding: 20rpx;
  306. .photo {
  307. background-color: #F5F7FA;
  308. width: 88rpx;
  309. height: 88rpx;
  310. border-radius: 80rpx;
  311. }
  312. .employee-main-info {
  313. height: 84rpx;
  314. margin-left: 20rpx;
  315. align-self: center;
  316. display: flex;
  317. flex-direction: column;
  318. justify-content: center;
  319. margin-bottom: 20rpx;
  320. flex: 1;
  321. .employee-name {
  322. height: 44rpx;
  323. line-height: 44rpx;
  324. font-size: 28rpx;
  325. font-weight: 500;
  326. color: #333333;
  327. }
  328. .employee-phone {
  329. height: 40rpx;
  330. line-height: 40rpx;
  331. font-size: 24rpx;
  332. color: #666666;
  333. }
  334. }
  335. .employee-actions {
  336. display: flex;
  337. align-items: center;
  338. height: 116rpx;
  339. background-color: #fff;
  340. border-radius: 32rpx;
  341. margin-top: 16rpx;
  342. .status-badge {
  343. display: flex;
  344. align-items: center;
  345. font-size: 26rpx;
  346. margin-right: 16rpx;
  347. .enabled {
  348. // background-color: #e6f7ff;
  349. margin-left: 16rpx;
  350. color: #1B64F0;
  351. }
  352. .disabled {
  353. // background-color: #f5f5f5;
  354. margin-left: 16rpx;
  355. color: #333333;
  356. }
  357. }
  358. .btn-view-order {
  359. height: 40rpx;
  360. font-weight: 400;
  361. font-size: 24rpx;
  362. color: #1B64F0;
  363. line-height: 40rpx;
  364. text-align: left;
  365. margin-right: 16rpx;
  366. }
  367. .dismiss-btn {
  368. width: 88rpx;
  369. height: 60rpx;
  370. line-height: 60rpx;
  371. text-align: center;
  372. background: #F52929;
  373. border-radius: 8rpx;
  374. font-size: 28rpx;
  375. color: #FFFFFF;
  376. }
  377. }
  378. }
  379. .submit-button {
  380. flex: 1;
  381. height: 88rpx;
  382. line-height: 88rpx;
  383. background-color: #1B64F0;
  384. color: #fff;
  385. text-align: center;
  386. border-radius: 16rpx;
  387. .submit-text {
  388. font-size: 32rpx;
  389. font-weight: bold;
  390. }
  391. }
  392. </style>