猫妈狗爸伴宠师小程序前端代码
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.

219 lines
5.5 KiB

3 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
2 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view>
  3. <view class="swiper-container">
  4. <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" style="height: 370rpx;">
  5. <swiper-item class="w-100 h-100" v-for="item in state.banner" :key="item.id">
  6. <image class="w-100 h-100" :src="item.image" mode=""></image>
  7. </swiper-item>
  8. </swiper>
  9. </view>
  10. <view class="container">
  11. <view class="container-list">
  12. <view class="mb28 col3 font32">合伙人工作台</view>
  13. <!-- 申请加入 -->
  14. <view class="container-list-but font28" >
  15. <view class="explain">
  16. <view class="explain-text">
  17. <text>{{ configList?.partner_work_statement?.paramValueText }}</text>
  18. <view class="font24 add-but col-white join"
  19. style="background-color: #999;color: #fff;"
  20. @click="">暂未开放 ></view>
  21. <!-- <view class="font24 add-but col-white join" @click="handleJoin(1)">申请加入 ></view> -->
  22. </view>
  23. <image class="explain-img" :src="configList?.partner_work_statement?.paramValueImage"
  24. mode="aspectFit"></image>
  25. </view>
  26. </view>
  27. <!-- 申请加入后 -->
  28. <!-- <view class="flex flex-between font24 flex-wrap" v-if="userInfo.userHh==1">
  29. <view class="icon-list" @click="handleGoto(item)" v-for="item in iconState.list1" :key="item.id">
  30. <up-image class="mb20" :show-loading="true" :src="item.image" width="68rpx"
  31. height="68rpx"></up-image>
  32. <view>{{item.name}}</view>
  33. </view>
  34. <view class="icon-list"></view>
  35. </view> -->
  36. </view>
  37. <view class="container-list">
  38. <view class="mb28 col3 font32">伴宠师工作台</view>
  39. <!-- 申请之前 -->
  40. <view class="container-list-but" style="background: #FFECE5" v-if="userInfo.userBcs != 1">
  41. <view class="explain">
  42. <view class="explain-text">
  43. <text>{{ configList?.pet_teacher_statement?.paramValueText }}</text>
  44. <view class="font24 add-but col-white join" @click="handleJoin(2)"
  45. style="background: #FF7935">申请加入 ></view>
  46. </view>
  47. <image class="explain-img" :src="configList?.pet_teacher_statement?.paramValueImage"
  48. mode="aspectFit"></image>
  49. </view>
  50. </view>
  51. <!-- 申请之后 -->
  52. <view class="flex-rowl flex-wrap" v-if="userInfo.userBcs == 1" >
  53. <view class="icon-list" v-for="item in iconState.list2" :key="item.id" @click="handleGoto(item)">
  54. <up-image class="mb20" :show-loading="true" :src="item.image" width="68rpx"
  55. height="68rpx"></up-image>
  56. <view>{{ item.name }}</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <ModalCom :open="isoOpen" @close="modalClose" />
  62. <configPopup ref="configPopupRef" />
  63. </view>
  64. </template>
  65. <script setup>
  66. import ModalCom from "./components/modal.vue"
  67. import {
  68. onShow
  69. } from "@dcloudio/uni-app"
  70. import {
  71. banner,
  72. joinHh,
  73. joiBcs,
  74. indexConfig,
  75. indexConfigIco,
  76. getbaseInfo
  77. } from "../../api/home.js"
  78. import {
  79. computed,
  80. onMounted,
  81. reactive,
  82. ref
  83. } from "vue";
  84. import tab from "../../plugins/tab";
  85. import {
  86. getLoginStatus
  87. } from "../../utils/useMixin";
  88. import {
  89. useStore
  90. } from "vuex"
  91. import configPopup from '@/components/configPopup.vue'
  92. const configPopupRef = ref(null)
  93. const store = useStore();
  94. const state = reactive({
  95. banner: []
  96. })
  97. onMounted(() => {
  98. getBanner()
  99. getpz()
  100. })
  101. const userInfo = computed(() => {
  102. return store.getters.userInfo
  103. })
  104. const configList = computed(() => {
  105. return store.getters.configList
  106. })
  107. // 获取轮播图
  108. const getBanner = async () => {
  109. const res = await banner()
  110. if (res.code === 200) {
  111. state.banner = [...res.data]
  112. }
  113. }
  114. // 申请加入合伙人
  115. const num = ref(0)
  116. const isoOpen = ref(false)
  117. const handleJoin = (type) => {
  118. num.value = Number(type)
  119. const info = uni.getStorageSync("baseInfo")
  120. if (!info) {
  121. uni.navigateTo({
  122. url: "/pages/login/index"
  123. })
  124. return
  125. }
  126. const baseInfo = JSON.parse(info)
  127. if (type === 1) {
  128. // 加入合伙人工作台
  129. joinHh({
  130. appUserId: baseInfo.userId
  131. }).then(res => {
  132. isoOpen.value = true
  133. store.dispatch("getUserInfo");
  134. }).catch(() => {})
  135. } else {
  136. // 加入伴宠师工作台
  137. handleBc()
  138. // joiBcs({
  139. // appUserId: baseInfo.userId
  140. // }).then(res => {
  141. // isoOpen.value = true
  142. // changeBaseInfo(baseInfo.userId)
  143. // })
  144. }
  145. }
  146. // 更新基本信息
  147. const changeBaseInfo = (userId) => {
  148. getbaseInfo(userId).then(res => {
  149. })
  150. }
  151. const modalClose = () => {
  152. isoOpen.value = false
  153. if (num.value === 1) {
  154. show.value = false
  155. } else {
  156. show.value = false
  157. }
  158. }
  159. // 获取工作台图标
  160. const iconState = reactive({
  161. list1: [],
  162. list2: [],
  163. })
  164. const getpz = () => {
  165. indexConfig().then(res => {
  166. // 合伙人工作台菜单
  167. iconState.list1 = res?.rows?.slice(0, 4) || [];
  168. // 伴宠师工作台
  169. iconState.list2 = res?.rows?.slice(4) || [];
  170. })
  171. }
  172. const show = ref(true)
  173. const hhShow = ref(true)
  174. const handleGoto = (item) => {
  175. if(item.name == '平台手册'){
  176. // pet_platform_introduction
  177. return configPopupRef.value.open('pet_platform_introduction')
  178. }
  179. if(item.url) {
  180. uni.navigateTo({
  181. url: item.url
  182. })
  183. }
  184. }
  185. // 加入合伙人
  186. const handleAdd = (type) => {
  187. if (!getLoginStatus()) return
  188. switch (type) {
  189. case 1:
  190. break
  191. case 2:
  192. tab.navigateTo("/otherPages/workbenchManage/feedingStaff/index")
  193. break
  194. }
  195. }
  196. const handleOpen = () => {
  197. show.value = false
  198. }
  199. const handleBc = () => {
  200. uni.navigateTo({
  201. url: "/otherPages/authentication/list/index"
  202. })
  203. }
  204. </script>
  205. <style scoped lang="scss">
  206. @import "index";
  207. </style>