Merchant.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="main-content">
  3. <view class="title">请选择您的知识店铺</view>
  4. <view v-if="hasShop" class="shop-card">
  5. <view class="shop-info" @click="jump()">
  6. <image class="shop-icon" src="/static/shop.png" />
  7. <view class="shop-name">知识店铺_WVV350567 <text class="shop-tag">试用版</text></view>
  8. <view class="shop-status">最近访问</view>
  9. </view>
  10. <view class="shop-detail">
  11. <view>试用期至:2025-05-10(已过期)</view>
  12. <view>访问身份:创建者</view>
  13. </view>
  14. </view>
  15. <view v-else class="no-shop">
  16. <image class="no-shop-img" src="/static/no_shop.png" />
  17. <view class="no-shop-text">暂无知识店铺,请创建</view>
  18. </view>
  19. <button class="create-btn" @click="goToShopHome">创建知识店铺</button>
  20. <view class="kefu-btn" @click="onKefu">
  21. <image class="kefu-img" src="/static/kefu.png" />
  22. <text>开店咨询</text>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. hasShop: true // 模拟有无店铺
  31. }
  32. },
  33. onLoad() {
  34. },
  35. methods: {
  36. jump(){
  37. console.log("123123")
  38. wx.navigateToMiniProgram({
  39. appId: 'wx3d250e9c83ec74ee', // 必填,未发布小程序的AppID(开发版/体验版均可)
  40. path: 'pages/index/index', // 选填,如:'pages/index/index'
  41. envVersion: 'develop', // 选填,指定跳转环境:develop(开发版)、trial(体验版)、release(正式版),未发布时用'develop'
  42. success(res) {
  43. // 跳转成功回调
  44. },
  45. fail(res) {
  46. // 跳转失败回调(常见原因:AppID错误、未关联、环境不正确)
  47. }
  48. });
  49. },
  50. goToShopHome() {
  51. // 跳转到店铺首页
  52. uni.switchTab({
  53. url: '/pages/index/shopHome',
  54. })
  55. },
  56. onKefu() {
  57. uni.showToast({ title: '客服功能待接入', icon: 'none' })
  58. }
  59. }
  60. }
  61. </script>
  62. <style>
  63. .main-content {
  64. padding: 40rpx 30rpx 120rpx 30rpx;
  65. }
  66. .title {
  67. font-size: 44rpx;
  68. font-weight: bold;
  69. margin-bottom: 40rpx;
  70. }
  71. .shop-card {
  72. background: #f8fafd;
  73. border-radius: 20rpx;
  74. padding: 36rpx 30rpx;
  75. margin-bottom: 40rpx;
  76. box-shadow: 0 2rpx 8rpx #f0f1f2;
  77. }
  78. .shop-info {
  79. display: flex;
  80. align-items: center;
  81. margin-bottom: 16rpx;
  82. }
  83. .shop-icon {
  84. width: 60rpx;
  85. height: 60rpx;
  86. margin-right: 20rpx;
  87. }
  88. .shop-name {
  89. font-size: 32rpx;
  90. font-weight: 500;
  91. margin-right: 16rpx;
  92. }
  93. .shop-tag {
  94. font-size: 22rpx;
  95. color: #fff;
  96. background: #b3c6ff;
  97. border-radius: 8rpx;
  98. padding: 2rpx 10rpx;
  99. margin-left: 8rpx;
  100. }
  101. .shop-status {
  102. margin-left: auto;
  103. color: #b3b3b3;
  104. font-size: 26rpx;
  105. }
  106. .shop-detail {
  107. color: #888;
  108. font-size: 26rpx;
  109. }
  110. .no-shop {
  111. display: flex;
  112. flex-direction: column;
  113. align-items: center;
  114. margin-bottom: 40rpx;
  115. }
  116. .no-shop-img {
  117. width: 180rpx;
  118. height: 180rpx;
  119. margin-bottom: 20rpx;
  120. }
  121. .no-shop-text {
  122. color: #b3b3b3;
  123. font-size: 30rpx;
  124. }
  125. .create-btn {
  126. width: 90%;
  127. margin: 0 auto 40rpx auto;
  128. background: #1880ff;
  129. color: #fff;
  130. font-size: 36rpx;
  131. border-radius: 50rpx;
  132. height: 90rpx;
  133. line-height: 90rpx;
  134. }
  135. .kefu-btn {
  136. position: fixed;
  137. right: 40rpx;
  138. bottom: 180rpx;
  139. display: flex;
  140. align-items: center;
  141. background: #eaf3ff;
  142. border-radius: 50rpx;
  143. padding: 10rpx 30rpx;
  144. box-shadow: 0 2rpx 8rpx #eaf3ff;
  145. }
  146. .kefu-img {
  147. width: 60rpx;
  148. height: 60rpx;
  149. margin-right: 10rpx;
  150. }
  151. </style>