enter.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <view>
  3. <view>
  4. <u-swiper :list="fileList"
  5. autoplay
  6. imgMode='aspectFit'
  7. height='200'
  8. radius='0'
  9. :circular="true"
  10. @change="e => current = e.current" @click="click">
  11. <view slot="indicator" class="indicator">
  12. <view
  13. class="indicator__dot"
  14. v-for="(item, index) in fileList"
  15. :key="index"
  16. :class="[index === current && 'indicator__dot--active']">
  17. </view>
  18. </view>
  19. </u-swiper>
  20. </view>
  21. <view>
  22. <luyj-grid-link :list="list" @gridExc="clickGrid"></luyj-grid-link>
  23. <u-modal :show="showAuthorizePhone" :showConfirmButton="false">
  24. <view class="slot-content">
  25. <view class="auth-card">
  26. <view class="img">
  27. <img class="avatar-img" src="@/static/image/logo.png" mode="widthFix">
  28. </view>
  29. <view class="content">手机登录后才能查看名片哦~</view>
  30. </view>
  31. <view class="auth-btncard">
  32. <view class="btn-unok">
  33. <u-button :customStyle="customStyleUnOk" @click="showAuthorizePhone=false" :plain="true">
  34. 拒绝</u-button>
  35. </view>
  36. <view class="btn-ok">
  37. <u-button :customStyle="customStyleOk" open-type="getPhoneNumber"
  38. @getphonenumber="getPhoneNumber"> 立即登录</u-button>
  39. </view>
  40. </view>
  41. </view>
  42. </u-modal>
  43. <u-modal :show="showAuthorizeUser" :showConfirmButton="false">
  44. <view class="slot-content">
  45. <view class="auth-card">
  46. <view class="img">
  47. <img class="avatar-img" src="/static/image/logo.png" mode="widthFix">
  48. </view>
  49. <view class="content">邀请您补全个人信息<br></br>(昵称、头像)</view>
  50. <view style="margin-left: 100rpx;margin-right: 100rpx">
  51. <u-form :model="userInfo" ref="uForm">
  52. <u-form-item label="头像">
  53. <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"
  54. slot="right">
  55. <image class="avatar"
  56. :src="userInfo.head?userInfo.head:'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'">
  57. </image>
  58. </button>
  59. </u-form-item>
  60. <u-form-item label="昵称">
  61. <u-input inputAlign='right' v-model="userInfo.nickname" class="weui-input"
  62. @blur="userNameInput" placeholder="请输入昵称" border="false" />
  63. <!-- <input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/> -->
  64. </u-form-item>
  65. </u-form>
  66. </view>
  67. </view>
  68. <view class="auth-btncard">
  69. <view class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="authUser(0)">
  70. 拒绝</u-button>
  71. </view>
  72. <view class="btn-ok">
  73. <u-button :customStyle="customStyleOk" @click="authUser(1)"> 允许</u-button>
  74. </view>
  75. </view>
  76. </view>
  77. </u-modal>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. var that
  83. import luyjGridLink from '@/uni_modules/lxm-fold-link/luyj-grid-link/components/luyj-grid-link/luyj-grid-link.vue'
  84. export default {
  85. components: {
  86. "luyjGridLink": luyjGridLink
  87. },
  88. data() {
  89. return {
  90. fileList:[],
  91. showAuthorizePhone:false,
  92. showAuthorizeUser:false,
  93. userInfo: {
  94. head: '',
  95. nickname: '',
  96. phone: '',
  97. },
  98. customStyleUnOk: {
  99. marginTop: '20rpx',
  100. color: '#5F7DE9',
  101. border: '2px solid #5F7DE9',
  102. "border-radius": "10px",
  103. fontSize: "32rpx"
  104. },
  105. customStyleOk: {
  106. marginTop: '20rpx',
  107. color: '#fff',
  108. border: '2px solid #5F7DE9',
  109. "border-radius": "10px",
  110. fontSize: "32rpx",
  111. background: "#5F7DE9"
  112. },
  113. list: [
  114. {
  115. title: '全部分类',
  116. // cur: 'basic',
  117. bgColor: '', // 背景颜色
  118. color: 'blue',
  119. title_show: true,
  120. showAll: false,
  121. colNumber: 4, // 显示的列数
  122. iconsList: [
  123. {
  124. cuIcon: '1_canyin-35',
  125. color: 'blue',
  126. name: '餐饮',
  127. url: '/pageA/enter/cateringindustry'
  128. },
  129. {
  130. cuIcon: 'zufang',
  131. color: 'blue',
  132. name: '民宿',
  133. url: '/pageA/enter/homestay'
  134. },
  135. {
  136. cuIcon: 'jiudian-38',
  137. color: 'blue',
  138. name: '酒店',
  139. url: '/pageA/enter/hotel'
  140. }
  141. ]
  142. },
  143. {
  144. title: '我的入驻',
  145. // cur: 'basic',
  146. bgColor: '', // 背景颜色
  147. color: 'blue',
  148. title_show: true,
  149. showAll: false,
  150. colNumber: 4, // 显示的列数
  151. iconsList: [
  152. {
  153. cuIcon: '1_canyin-35',
  154. color: 'blue',
  155. name: '餐饮',
  156. url: '/pageA/enter/myCateringdustry/index'
  157. },
  158. {
  159. cuIcon: 'zufang',
  160. color: 'blue',
  161. name: '民宿',
  162. url: '/pageA/enter/myHomestay/index'
  163. },
  164. {
  165. cuIcon: 'jiudian-38',
  166. color: 'blue',
  167. name: '酒店',
  168. url: '/pageA/enter/hotel'
  169. }
  170. ]
  171. },
  172. ],
  173. }
  174. },
  175. onLoad(){
  176. that = this
  177. this.getList()
  178. },
  179. onShow: function() {
  180. let _isLoad = uni.getStorageSync("scanAddCardToIndex")
  181. if (uni.getStorageSync("userInfo").phone) {
  182. // that.$request.baseRequest('admin.unimall.cardNewsInfo', 'list', {
  183. // receiveId: uni.getStorageSync("userInfo").id,
  184. // }, failres => {
  185. // console.log('res+++++', failres.errmsg)
  186. // that.$refs.uToast.show({
  187. // type: 'error',
  188. // message: failres.errmsg,
  189. // })
  190. // }).then(res => {
  191. // that.noticeList = res.data.items
  192. // if (that.noticeList.length > 0) {
  193. // var data = that.noticeList.filter((item) => {
  194. // return item.newsFlag == 0
  195. // })
  196. // that.unread = data ? data.length : 0
  197. // }
  198. // console.log(that.unread)
  199. // })
  200. } else {
  201. this.showAuthorizePhone = true
  202. }
  203. },
  204. methods: {
  205. getList(){
  206. this.$request.baseRequest('admin.tourism.carouselManagement', 'list', {
  207. page: 1,
  208. limit: 9999,
  209. classify:'商家版首页'
  210. }, failres => {
  211. uni.showToast({
  212. icon: "none",
  213. title: failres.errmsg,
  214. duration: 3000
  215. });
  216. }).then(res => {
  217. this.fileList=res.data.items
  218. })
  219. },
  220. toDetail(url){
  221. uni.navigateTo({
  222. url:url
  223. })
  224. },
  225. async getPhoneNumber(e) {
  226. that.userInfo = await this.$request.wxlogin()
  227. that.userInfo.phone = await this.$request.getPhone(e, that.userInfo)
  228. this.showAuthorizePhone = false
  229. this.showAuthorizeUser = true
  230. },
  231. async authUser(type) {
  232. //同步信息,没有头像和昵称自动生成
  233. this.userInfo = await this.$request.syncInfo(this.userInfo)
  234. if (this.userInfo.openId) {
  235. uni.setStorageSync("userInfo", that.userInfo)
  236. that.showAuthorizeUser = false
  237. // that.mescroll.resetUpScroll()
  238. }
  239. },
  240. }
  241. }
  242. </script>
  243. <style lang="scss" scoped>
  244. .slot-content {
  245. width: 100%;
  246. }
  247. /deep/.u-checkbox-group {
  248. position: absolute;
  249. right: 20px;
  250. z-index: 99;
  251. top: 30px;
  252. }
  253. /deep/.u-checkbox__icon-wrap.u-checkbox__icon-wrap--square {
  254. border-color: #D7DEEB !important;
  255. }
  256. /deep/.mescroll-body {
  257. min-height: 558px !important;
  258. height: 558px !important;
  259. background-color: green;
  260. overflow: scroll !important;
  261. }
  262. .auth-btncard {
  263. display: flex !important;
  264. justify-content: space-between !important;
  265. .btn-unok {
  266. width: 40%;
  267. }
  268. .btn-ok {
  269. width: 40%;
  270. }
  271. }
  272. .auth-card {
  273. text-align: center;
  274. .avatar-img {
  275. width: 250rpx;
  276. }
  277. .title {
  278. font-size: 20rpx;
  279. }
  280. .content {
  281. font-size: 32rpx;
  282. font-weight: bold;
  283. color: #1A1A1A;
  284. margin-bottom: 30rpx;
  285. }
  286. }
  287. .avatar-wrapper {
  288. color: #333 !important;
  289. border: none !important;
  290. border-radius: 0 !important;
  291. background-color: transparent !important;
  292. padding: 0;
  293. }
  294. .avatar-wrapper::after {
  295. border: none !important;
  296. }
  297. .avatar {
  298. width: 100rpx;
  299. height: 100rpx;
  300. overflow: hidden;
  301. border-radius: 100%;
  302. }
  303. /deep/.u-popup__content {
  304. border-radius: 20rpx !important;
  305. }
  306. </style>