enter.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <view>
  3. <u-navbar
  4. title="入驻"
  5. placeholder='true'
  6. >
  7. <view
  8. class="u-nav-slot"
  9. slot="left"
  10. >
  11. </view>
  12. </u-navbar>
  13. <view>
  14. <u-swiper :list="fileList"
  15. autoplay
  16. imgMode='aspectFit'
  17. height='200'
  18. radius='0'
  19. :circular="true"
  20. @change="e => current = e.current" @click="click">
  21. <view slot="indicator" class="indicator">
  22. <view
  23. class="indicator__dot"
  24. v-for="(item, index) in fileList"
  25. :key="index"
  26. :class="[index === current && 'indicator__dot--active']">
  27. </view>
  28. </view>
  29. </u-swiper>
  30. </view>
  31. <view>
  32. <luyj-grid-link :list="list" @gridExc="clickGrid" @switchChange='switchChange'></luyj-grid-link>
  33. </view>
  34. <u-modal :show="editshow" @confirm="$u.debounce(confirm,500)" title="选择自动跳转内容" >
  35. <view class="slot-content">
  36. <u-radio-group
  37. v-model="radiovalue1"
  38. placement="column"
  39. @change="groupChange"
  40. >
  41. <u-radio
  42. :customStyle="{marginBottom: '8px'}"
  43. v-for="(item, index) in radiolist1"
  44. :key="index"
  45. :label="item.value"
  46. :name="item.value"
  47. >
  48. </u-radio>
  49. </u-radio-group>
  50. </view>
  51. </u-modal>
  52. <u-tabbar
  53. :value="tabbarCheck"
  54. @change="name => tabbarCheck = name"
  55. activeColor="#5F7DE9"
  56. >
  57. <u-tabbar-item name="team" text="加入">
  58. <image
  59. class="u-page__item__slot-icon"
  60. slot="active-icon"
  61. src="@/static/image/nav-icon/antOutline-team Copy.png"
  62. ></image>
  63. <image
  64. class="u-page__item__slot-icon"
  65. slot="inactive-icon"
  66. src="@/static/image/nav-icon/antOutline-team.png"
  67. ></image>
  68. </u-tabbar-item>
  69. <u-tabbar-item name="notification" text="通知">
  70. <image
  71. class="u-page__item__slot-icon"
  72. slot="active-icon"
  73. src="@/static/image/nav-icon/md-notifications_none Copy.png"
  74. ></image>
  75. <image
  76. class="u-page__item__slot-icon"
  77. slot="inactive-icon"
  78. src="@/static/image/nav-icon/md-notifications_none.png"
  79. ></image>
  80. </u-tabbar-item>
  81. <u-tabbar-item name="user" text="我的">
  82. <image
  83. class="u-page__item__slot-icon"
  84. slot="active-icon"
  85. src="@/static/image/nav-icon/antOutline-user1 Copy.png"
  86. ></image>
  87. <image
  88. class="u-page__item__slot-icon"
  89. slot="inactive-icon"
  90. src="@/static/image/nav-icon/antOutline-user1.png"
  91. ></image>
  92. </u-tabbar-item>
  93. </u-tabbar>
  94. </view>
  95. </template>
  96. <script>
  97. var that
  98. import luyjGridLink from '@/uni_modules/lxm-fold-link/luyj-grid-link/components/luyj-grid-link/luyj-grid-link.vue'
  99. export default {
  100. components: {
  101. "luyjGridLink": luyjGridLink
  102. },
  103. data() {
  104. return {
  105. fileList:[],
  106. editshow:false,
  107. tabbarCheck:'team',
  108. showAuthorizePhone:false,
  109. showAuthorizeUser:false,
  110. radiolist1:[],
  111. radiovalue1:'',
  112. userInfo: {
  113. head: '',
  114. nickname: '',
  115. phone: '',
  116. },
  117. customStyleUnOk: {
  118. marginTop: '20rpx',
  119. color: '#5F7DE9',
  120. border: '2px solid #5F7DE9',
  121. "border-radius": "10px",
  122. fontSize: "32rpx"
  123. },
  124. customStyleOk: {
  125. marginTop: '20rpx',
  126. color: '#fff',
  127. border: '2px solid #5F7DE9',
  128. "border-radius": "10px",
  129. fontSize: "32rpx",
  130. background: "#5F7DE9"
  131. },
  132. list: [
  133. {
  134. title: '全部分类',
  135. // cur: 'basic',
  136. bgColor: '', // 背景颜色
  137. color: 'blue',
  138. title_show: true,
  139. showAll: false,
  140. colNumber: 4, // 显示的列数
  141. iconsList: [
  142. {
  143. cuIcon: '1_canyin-35',
  144. color: 'blue',
  145. name: '餐饮',
  146. status:true,
  147. url: '/pageA/enter/cateringindustry'
  148. },
  149. {
  150. cuIcon: 'zufang',
  151. color: 'blue',
  152. name: '民宿',
  153. status:true,
  154. url: '/pageA/enter/homestay'
  155. },
  156. {
  157. cuIcon: 'jiudian-38',
  158. color: 'blue',
  159. name: '酒店',
  160. status:true,
  161. url: '/pageA/enter/hotel'
  162. }
  163. ]
  164. },
  165. {
  166. title: '我的入驻',
  167. // cur: 'basic',
  168. bgColor: '', // 背景颜色
  169. color: 'blue',
  170. title_show: true,
  171. foodEntry:0,
  172. homeEntry:0,
  173. hotelEntry:0,
  174. switch:true,
  175. showAll: false,
  176. switch_status:true,
  177. colNumber: 4, // 显示的列数
  178. iconsList: [
  179. {
  180. cuIcon: '1_canyin-35',
  181. color: 'blue',
  182. name: '餐饮',
  183. status:true,
  184. url: '/pageA/enter/myCateringdustry/index'
  185. },
  186. {
  187. cuIcon: 'zufang',
  188. color: 'blue',
  189. name: '民宿',
  190. status:true,
  191. url: '/pageA/enter/myHomestay/index'
  192. },
  193. {
  194. cuIcon: 'jiudian-38',
  195. color: 'blue',
  196. name: '酒店',
  197. status:true,
  198. url: '/pageA/enter/hotel'
  199. }
  200. ]
  201. },
  202. ],
  203. }
  204. },
  205. onLoad(){
  206. that = this
  207. this.userInfo=uni.getStorageSync("userInfo")
  208. if(uni.getStorageSync("userInfo").phone&&uni.getStorageSync("userInfo").automaticSkip){
  209. if(uni.getStorageSync("userInfo").autoModule=='foodEntry'){
  210. uni.navigateTo({
  211. url:'/pageA/enter/myCateringdustry/index'
  212. })
  213. }else if(uni.getStorageSync("userInfo").autoModule=='homeEntry'){
  214. uni.navigateTo({
  215. url:'/pageA/enter/myHomestay/index'
  216. })
  217. }else if(uni.getStorageSync("userInfo").autoModule=='hotelEntry'){
  218. uni.navigateTo({
  219. url:'/pageA/enter/hotel'
  220. })
  221. }
  222. }
  223. this.getList()
  224. },
  225. onShow: function() {
  226. let _isLoad = uni.getStorageSync("scanAddCardToIndex")
  227. if (uni.getStorageSync("userInfo").phone) {
  228. if(uni.getStorageSync("userInfo").foodEntry==0&&uni.getStorageSync("userInfo").homeEntry==0&&uni.getStorageSync("userInfo").hotelEntry==0){
  229. this.list[1].switch_status=false
  230. }else{
  231. this.list[1].switch_status=uni.getStorageSync("userInfo").automaticSkip?true:false
  232. }
  233. if(uni.getStorageSync("userInfo").foodEntry>0){
  234. this.list[1].iconsList[0].status=true
  235. }else{
  236. this.list[1].iconsList[0].status=false
  237. }
  238. if(uni.getStorageSync("userInfo").homeEntry>0){
  239. this.list[1].iconsList[1].status=true
  240. this.list[0].iconsList[1].status=false
  241. }else{
  242. this.list[1].iconsList[1].status=false
  243. this.list[0].iconsList[1].status=true
  244. }
  245. if(uni.getStorageSync("userInfo").hotelEntry>0){
  246. this.list[1].iconsList[2].status=true
  247. this.list[0].iconsList[2].status=false
  248. }else{
  249. this.list[1].iconsList[2].status=false
  250. this.list[0].iconsList[2].status=true
  251. }
  252. } else {
  253. }
  254. },
  255. methods: {
  256. async confirm(){
  257. var data1=await this.updateUser()
  258. if(data1.errno==200){
  259. uni.setStorageSync("userInfo",this.userInfo)
  260. return
  261. }
  262. },
  263. groupChange(e){
  264. console.log(e)
  265. if(e=='餐饮'){
  266. this.userInfo.autoModule='foodEntry'
  267. }else if(e=='民宿'){
  268. this.userInfo.autoModule='homeEntry'
  269. }else if(e=='酒店'){
  270. this.userInfo.autoModule='hotelEntry'
  271. }
  272. },
  273. async switchChange(e){
  274. var status=e?1:0
  275. console.log(e,111111)
  276. this.userInfo.automaticSkip=status
  277. var data=await this.updateUser()
  278. console.log(data)
  279. if(data.errno==200){
  280. uni.setStorageSync("userInfo",this.userInfo)
  281. uni.showToast({
  282. icon: "none",
  283. title: '已开启自动跳转',
  284. duration: 3000
  285. });
  286. if(uni.getStorageSync("userInfo").foodEntry!=0&&uni.getStorageSync("userInfo").homeEntry==0&&uni.getStorageSync("userInfo").hotelEntry==0){
  287. this.userInfo.autoModule='foodEntry'
  288. var data1=await this.updateUser()
  289. if(data1.errno==200){
  290. uni.setStorageSync("userInfo",this.userInfo)
  291. return
  292. }
  293. }
  294. if(uni.getStorageSync("userInfo").foodEntry==0&&uni.getStorageSync("userInfo").homeEntry!=0&&uni.getStorageSync("userInfo").hotelEntry==0){
  295. this.userInfo.autoModule='homeEntry'
  296. var data1=await this.updateUser()
  297. if(data1.errno==200){
  298. uni.setStorageSync("userInfo",this.userInfo)
  299. return
  300. }
  301. }
  302. if(uni.getStorageSync("userInfo").foodEntry==0&&uni.getStorageSync("userInfo").homeEntry==0&&uni.getStorageSync("userInfo").hotelEntry!=0){
  303. this.userInfo.autoModule='hotelEntry'
  304. var data1=await this.updateUser()
  305. if(data1.errno==200){
  306. uni.setStorageSync("userInfo",this.userInfo)
  307. return
  308. }
  309. }
  310. this.radiolist1=[]
  311. if(uni.getStorageSync("userInfo").foodEntry!=0){
  312. this.radiolist1.push({value:'餐饮'})
  313. }
  314. if(uni.getStorageSync("userInfo").homeEntry!=0){
  315. this.radiolist1.push({value:'民宿'})
  316. }
  317. if(uni.getStorageSync("userInfo").hotelEntry!=0){
  318. this.radiolist1.push({value:'酒店'})
  319. }
  320. if(e){
  321. this.editshow = true
  322. }
  323. }else{
  324. uni.showToast({
  325. icon: "none",
  326. title: '自动跳转开启失败',
  327. duration: 3000
  328. });
  329. this.userInfo.automaticSkip = status == 0 ? false : true
  330. }
  331. },
  332. getList(){
  333. this.$request.baseRequest('admin.tourism.carouselManagement', 'list', {
  334. page: 1,
  335. limit: 9999,
  336. classify:'商家版首页'
  337. }, failres => {
  338. uni.showToast({
  339. icon: "none",
  340. title: failres.errmsg,
  341. duration: 3000
  342. });
  343. }).then(res => {
  344. this.fileList=res.data.items
  345. })
  346. },
  347. toDetail(url){
  348. uni.navigateTo({
  349. url:url
  350. })
  351. },
  352. updateUser(){
  353. return new Promise((resolve, reject) => {
  354. that.$request.baseRequest('admin.unimall.commonUserInfo', 'list', {
  355. commonUserInfo:JSON.stringify(this.userInfo)
  356. }, failres => {
  357. reject(failres)
  358. }).then(res => {
  359. resolve(res)
  360. })
  361. })
  362. },
  363. async getPhoneNumber(e) {
  364. that.userInfo = await this.$request.wxlogin()
  365. that.userInfo.phone = await this.$request.getPhone(e, that.userInfo)
  366. this.showAuthorizePhone = false
  367. this.showAuthorizeUser = true
  368. },
  369. async authUser(type) {
  370. //同步信息,没有头像和昵称自动生成
  371. this.userInfo = await this.$request.syncInfo(this.userInfo)
  372. if (this.userInfo.openId) {
  373. uni.setStorageSync("userInfo", that.userInfo)
  374. that.showAuthorizeUser = false
  375. // that.mescroll.resetUpScroll()
  376. }
  377. },
  378. }
  379. }
  380. </script>
  381. <style lang="scss" scoped>
  382. .slot-content {
  383. width: 100%;
  384. }
  385. /deep/.u-checkbox-group {
  386. position: absolute;
  387. right: 20px;
  388. z-index: 99;
  389. top: 30px;
  390. }
  391. /deep/.u-checkbox__icon-wrap.u-checkbox__icon-wrap--square {
  392. border-color: #D7DEEB !important;
  393. }
  394. /deep/.mescroll-body {
  395. min-height: 558px !important;
  396. height: 558px !important;
  397. background-color: green;
  398. overflow: scroll !important;
  399. }
  400. .auth-btncard {
  401. display: flex !important;
  402. justify-content: space-between !important;
  403. .btn-unok {
  404. width: 40%;
  405. }
  406. .btn-ok {
  407. width: 40%;
  408. }
  409. }
  410. .auth-card {
  411. text-align: center;
  412. .avatar-img {
  413. width: 250rpx;
  414. }
  415. .title {
  416. font-size: 20rpx;
  417. }
  418. .content {
  419. font-size: 32rpx;
  420. font-weight: bold;
  421. color: #1A1A1A;
  422. margin-bottom: 30rpx;
  423. }
  424. }
  425. .avatar-wrapper {
  426. color: #333 !important;
  427. border: none !important;
  428. border-radius: 0 !important;
  429. background-color: transparent !important;
  430. padding: 0;
  431. }
  432. .avatar-wrapper::after {
  433. border: none !important;
  434. }
  435. .avatar {
  436. width: 100rpx;
  437. height: 100rpx;
  438. overflow: hidden;
  439. border-radius: 100%;
  440. }
  441. /deep/.u-popup__content {
  442. border-radius: 20rpx !important;
  443. }
  444. /deep/.u-tabbar-item image{
  445. width:40rpx;
  446. height:40rpx;
  447. }
  448. </style>