index.vue 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069
  1. <template>
  2. <!-- 个人中心模块 -->
  3. <view class="new-users copy-data" :style="{height:pageHeight}">
  4. <!-- 自定义顶部背景颜色 -->
  5. <view class="top" :style="colorStyle">
  6. <!-- #ifdef MP || APP-PLUS -->
  7. <view class="sys-head">
  8. <view class="sys-bar" :style="{height:sysHeight}"></view>
  9. <!-- #ifdef MP -->
  10. <view class="sys-title" :style="member_style==3?'color:#333':''">个人中心</view>
  11. <!-- #endif -->
  12. <view class="bg" :style="member_style==3?'background:#f5f5f5':''"></view>
  13. </view>
  14. <!-- #endif -->
  15. </view>
  16. <!-- 自定义顶部背景颜色 -->
  17. <view class="mid style-add" :style="colorStyle">
  18. <scroll-view scroll-y="true" class="height-add">
  19. <view class="head">
  20. <view class="user-card" :class="member_style==3?'unBg':''"
  21. :style="{backgroundImage:'url('+imgHost+'/statics/images/user01.png'+')'}">
  22. <view class="bg"></view>
  23. <!-- 个人资料展示 -->
  24. <view class="user-info">
  25. <view>
  26. <!-- 公众号未授权时显示 -->
  27. <!-- #ifdef H5 -->
  28. <button class="bntImg" v-if="userInfo.is_complete == 0 && isWeixin" @click="getWechatuserinfo">
  29. <image class="avatar" src='/static/images/f.png'></image>
  30. <view class="avatarName">获取头像</view>
  31. </button>
  32. <!-- #endif -->
  33. <!-- #ifdef MP -->
  34. <button class="bntImg" v-if="userInfo.is_complete == 0" @tap="getUserProfile">
  35. <image class="avatar" src='/static/images/f.png'></image>
  36. <view class="avatarName">获取头像</view>
  37. </button>
  38. <!-- #endif -->
  39. <!-- #ifndef APP-PLUS -->
  40. <view v-else class="avatar-box" :class="{on:userInfo.is_money_level}">
  41. <image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar" @click="goEdit()">
  42. </image>
  43. <image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()">
  44. </image>
  45. <view class="headwear" v-if="userInfo.is_money_level && stu">
  46. <image src="/static/images/headwear.png"></image>
  47. </view>
  48. </view>
  49. <!-- #endif -->
  50. <!-- #ifdef APP-PLUS -->
  51. <view class="avatar-box" :class="{on:userInfo.is_money_level}">
  52. <image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar" @click="goEdit()">
  53. </image>
  54. <image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()">
  55. </image>
  56. <view class="headwear" v-if="userInfo.is_money_level && stu">
  57. <image src="/static/images/headwear.png"></image>
  58. <view>
  59. 未登录
  60. </view>
  61. </view>
  62. </view>
  63. <!-- #endif -->
  64. </view>
  65. <view class="info">
  66. <!-- #ifdef MP -->
  67. <view class="name display-add" v-if="!userInfo.uid" @click="openAuto">
  68. 请点击授权
  69. </view>
  70. <!-- #endif -->
  71. <!-- #ifdef H5 -->
  72. <view class="name display-add" v-if="!userInfo.uid" @click="openAuto">
  73. 请点击授权
  74. </view>
  75. <!-- #endif -->
  76. <view class="name" v-if="userInfo.uid">
  77. {{userInfo.nickname}}
  78. <image class="live" :src="userInfo.vip_icon" v-if="userInfo.vip_icon"></image>
  79. <view class="vip" v-if="userInfo.is_money_level> 0 && stu">
  80. <image src="/static/images/svip.png"></image>
  81. </view>
  82. </view>
  83. <view class="num" v-if="userInfo.phone" @click="goEdit()">
  84. <view class="num-txt">ID:{{userInfo.uid}}</view>
  85. <view class="icon">
  86. <image src="/static/images/edit.png" mode=""></image>
  87. </view>
  88. </view>
  89. <view class="phone" v-if="!userInfo.phone && isLogin" @tap="bindPhone">绑定手机号</view>
  90. </view>
  91. <view class="qrCode message iconfont icon-erweima-xingerenzhongxin" @click="tapQrCode">
  92. </view>
  93. <view class="message">
  94. <navigator url="/pages/users/user_info/index" hover-class="none">
  95. <view class="iconfont icon-shezhi"></view>
  96. </navigator>
  97. </view>
  98. <view class="message">
  99. <navigator url="/pages/users/message_center/index" hover-class="none">
  100. <view v-if="userInfo.service_num" class="num">
  101. {{userInfo.service_num >= 100 ? '99+' : userInfo.service_num}}
  102. </view>
  103. <view class="iconfont icon-s-kefu"></view>
  104. </navigator>
  105. </view>
  106. <!-- #ifdef MP -->
  107. <!-- <view class="setting" @click="Setting"><text class="iconfont icon-shezhi"></text></view> -->
  108. <!-- #endif -->
  109. </view>
  110. <view class="achsac">
  111. </view>
  112. <!-- <view class="sign" @click="goSignIn">签到</view> -->
  113. <!-- 会员权益 -->
  114. <view class="cardVipA acea-row row-between-wrapper" v-if="member_style==1 && stu && vip_type==2"
  115. :style="{backgroundImage:'url('+imgHost+'/statics/images/member.png'+')'}">
  116. <view class="left-box">
  117. <view v-if="vipStatus == 1" class="small">永久</view>
  118. <view v-else-if="vipStatus == 3" class="small">会员到期
  119. {{ userInfo.overdue_time | dateFormat }}
  120. </view>
  121. <view v-else-if="vipStatus == -1" class="small">已过期</view>
  122. <view v-else-if="vipStatus == 2" class="small">未开通会员</view>
  123. </view>
  124. <view class="acea-row row-middle">
  125. <navigator v-if="vipStatus == 1" url="/pages/annex/vip_paid/index" hover-class="none" class="btn">查看会员权益
  126. </navigator>
  127. <navigator v-else url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
  128. {{ userInfo.overdue_time ? '立即续费' : '立即激活' }}
  129. </navigator>
  130. <text class="iconfont icon-xiangyou"></text>
  131. </view>
  132. </view>
  133. <view class="cardVipB acea-row row-between" v-if="member_style==3 && stu && vip_type==2">
  134. <view class="left-box acea-row">
  135. <view class="pictrue">
  136. <image src="../../static/images/member01.png"></image>
  137. </view>
  138. <view v-if="vipStatus == 1" class="small">永久</view>
  139. <view v-else-if="vipStatus == 3" class="small">会员到期
  140. {{ userInfo.overdue_time | dateFormat }}
  141. </view>
  142. <view v-else-if="vipStatus == -1" class="small">已过期</view>
  143. <view v-else-if="vipStatus == 2" class="small">未开通会员</view>
  144. </view>
  145. <view class="acea-row">
  146. <navigator v-if="vipStatus == 1" url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
  147. 会员可享多项权益</navigator>
  148. <navigator v-else url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
  149. {{ userInfo.overdue_time ? '立即续费' : '立即激活' }}
  150. </navigator>
  151. <text class="iconfont icon-xiangyou btn"></text>
  152. </view>
  153. </view>
  154. <view class="cardVipA acea-row row-between-wrapper" :style="{backgroundImage:'url('+imgHost+'/statics/images/grade.png'+')'}" v-if="member_style==1 && memberStatus && vip_type==1">
  155. <view class="left-box on">
  156. <view class="small">{{userInfo.level_status==1?userInfo.vip_name:'激活会员卡 解锁更多权益'}}</view>
  157. </view>
  158. <view class="acea-row row-middle">
  159. <!-- 去激活 -->
  160. <navigator :url="userInfo.level_status==1?'/pages/annex/vip_grade/index':'/pages/annex/vip_grade_active/index'" hover-class="none" class="btn on">{{userInfo.level_status==1?'查看会员卡':'去激活'}}</navigator>
  161. <text class="iconfont icon-xiangyou on"></text>
  162. </view>
  163. </view>
  164. <view class="cardVipB acea-row row-between on" :style="{backgroundImage:'url('+imgHost+'/statics/images/grade01.png'+')'}" v-if="member_style==3 && memberStatus && vip_type==1">
  165. <view class="small">{{userInfo.level_status==1?userInfo.vip_name:'激活会员卡 解锁更多权益'}}</view>
  166. <view class="acea-row">
  167. <navigator :url="userInfo.level_status==1?'/pages/annex/vip_grade/index':'/pages/annex/vip_grade_active/index'" hover-class="none" class="btn on">{{userInfo.level_status==1?'查看会员卡':'去激活'}}</navigator>
  168. <text class="iconfont icon-xiangyou"></text>
  169. </view>
  170. </view>
  171. </view>
  172. <view class="card-vip" v-if="member_style==2 && stu && vip_type==2">
  173. <view class="left-box">
  174. <!-- <view class="big">会员可享多项权益</view> -->
  175. <view v-if="vipStatus == 1" class="small">永久</view>
  176. <view v-else-if="vipStatus == 3" class="small">会员到期
  177. {{ userInfo.overdue_time | dateFormat }}
  178. </view>
  179. <view v-else-if="vipStatus == -1" class="small">已过期</view>
  180. <view v-else-if="vipStatus == 2" class="small">未开通会员</view>
  181. </view>
  182. <view class="acea-row">
  183. <navigator v-if="vipStatus == 1" url="/pages/annex/vip_paid/index" hover-class="none" class="btn">查看会员权益
  184. </navigator>
  185. <navigator v-else url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
  186. {{ userInfo.overdue_time ? '立即续费' : '立即激活' }}
  187. </navigator>
  188. <text class="iconfont icon-xiangyou"></text>
  189. </view>
  190. </view>
  191. <view class="card-vip on" v-if="member_style==2 && memberStatus && vip_type==1" :style="{backgroundImage:'url('+imgHost+'/statics/images/grade01.png'+')'}">
  192. <view class="left-box">
  193. <view class="small">{{userInfo.level_status==1?userInfo.vip_name:'激活会员卡 解锁更多权益'}}</view>
  194. </view>
  195. <view class="acea-row">
  196. <navigator :url="userInfo.level_status==1?'/pages/annex/vip_grade/index':'/pages/annex/vip_grade_active/index'" hover-class="none" class="btn">{{userInfo.level_status==1?'查看会员卡':'去激活'}}</navigator>
  197. <text class="iconfont icon-xiangyou"></text>
  198. </view>
  199. </view>
  200. <view class="num-wrapper"
  201. :class="[member_style==3?'unNum-wrapper':member_style==2?'Tnum-wrapper':'',((vip_type==2 && stu) || (vip_type==1 && memberStatus))?'':'height']"
  202. v-if="userInfo.uid">
  203. <view class="num-item" v-show="userInfo.balance_func_status"
  204. @click="goMenuPage('/pages/users/user_money/index')">
  205. <text class="num">{{userInfo.now_money || 0}}</text>
  206. <view class="txt">余额</view>
  207. </view>
  208. <view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
  209. <text class="num">{{userInfo.couponCount || 0}}</text>
  210. <view class="txt">优惠券</view>
  211. </view>
  212. <view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
  213. <text class="num">{{userInfo.integral || 0}}</text>
  214. <view class="txt">积分</view>
  215. </view>
  216. <view class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index')">
  217. <text class="num">{{userInfo.collectCount || 0}}</text>
  218. <view class="txt">收藏</view>
  219. </view>
  220. <view class="num-item" @click="goMenuPage('/pages/users/visit_list/index')">
  221. <text class="num">{{userInfo.visit_num || 0}}</text>
  222. <view class="txt">浏览记录</view>
  223. </view>
  224. </view>
  225. <!-- 新人礼物 -->
  226. <view class="num-wrapper on" v-if="!userInfo.uid">
  227. <image :src="giftPic" mode="" class="img"></image>
  228. <view class="text">
  229. 登录即获得<text class="gift">新人大礼包</text>
  230. </view>
  231. <view class="btn-login" @click="openAuto">去登录</view>
  232. </view>
  233. <!-- 新人专享 -->
  234. <view class="newcomersCon" :class="newcomer_style==1?'':'on'" v-if="newList.length">
  235. <view class="newcomers" :style="{backgroundImage:'url('+ (newcomer_style==1?imgHost+'/statics/images/new-bg.png':newBg) +')'}">
  236. <view class="title">
  237. <view class="tl">
  238. 新人专享
  239. </view>
  240. <view class="tr" @click="goNewcomers">
  241. 更多 <text class="iconfont icon-xiangyou"></text>
  242. </view>
  243. </view>
  244. <scroll-view scroll-x="true" class="scroll">
  245. <view class="scroll-item" v-for="(item,index) in newList" :key="index" @click="goDetail(item)">
  246. <view class="pictrue">
  247. <image :src='item.image'></image>
  248. <view class="label">新人价</view>
  249. </view>
  250. <view class="money">¥{{item.price}}</view>
  251. </view>
  252. </scroll-view>
  253. </view>
  254. </view>
  255. <!-- 订单中心 -->
  256. <view class="order-wrapper">
  257. <view class="order-hd flex">
  258. <view class="left">订单中心</view>
  259. <navigator class="right flex" hover-class="none" url="/pages/goods/order_list/index" open-type="navigate">
  260. 查看全部
  261. <text class="iconfont icon-xiangyou"></text>
  262. </navigator>
  263. </view>
  264. <view class="order-bd">
  265. <block v-for="(item,index) in orderMenu" :key="index">
  266. <navigator class="order-item" hover-class="none" :url="item.url">
  267. <view class="pic">
  268. <!-- <image :src="item.img" mode=""></image> -->
  269. <text class="iconfont" :class="item.img"></text>
  270. <text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
  271. </view>
  272. <view class="txt">{{item.title}}</view>
  273. </navigator>
  274. </block>
  275. </view>
  276. </view>
  277. </view>
  278. <!-- 轮播 -->
  279. <view class="slider-wrapper" v-if="imgUrls.length>0 && my_banner_status">
  280. <swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
  281. :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
  282. <block v-for="(item,index) in imgUrls" :key="index">
  283. <swiper-item>
  284. <navigator @click="goMenuPage(item.url)" class='slide-navigator acea-row row-between-wrapper'
  285. hover-class='none'>
  286. <image :src="item.pic" class="slide-image"></image>
  287. </navigator>
  288. </swiper-item>
  289. </block>
  290. </swiper>
  291. </view>
  292. <!-- 会员菜单二 -->
  293. <view class="menus-list" v-if="menu_status == 2 && MyMenus.length">
  294. <view class="title">我的服务</view>
  295. <!-- #ifdef APP-PLUS || H5 -->
  296. <block v-for="(item,index) in MyMenus" :key="index">
  297. <view class="item acea-row row-between-wrapper" v-if="item.url!='#' && item.url!='/pages/service/index'"
  298. @click="goMenuPage(item.url, item.name)">
  299. <image :src="item.pic"></image>
  300. <view class="text acea-row row-between-wrapper">
  301. <view>{{item.name}}</view>
  302. <view class="iconfont icon-xiangyou"></view>
  303. </view>
  304. </view>
  305. </block>
  306. <!-- #endif -->
  307. <!-- #ifdef MP -->
  308. <block v-for="(item,index) in MyMenus" :key="index">
  309. <view class="item acea-row row-between-wrapper" v-if="item.url!='#'
  310. && item.url!='/pages/service/index'
  311. && item.url!='/pages/extension/customer_list/chat'
  312. || (item.url=='/pages/extension/customer_list/chat' && routineContact == 0)"
  313. @click="goMenuPage(item.url, item.name)">
  314. <image :src="item.pic"></image>
  315. <view class="text acea-row row-between-wrapper">
  316. <view>{{item.name}}</view>
  317. <view class="iconfont icon-xiangyou"></view>
  318. </view>
  319. </view>
  320. </block>
  321. <button class="item acea-row row-between-wrapper" open-type='contact' v-if="routineContact == 1">
  322. <image src="/static/images/contact.png"></image>
  323. <view class="text acea-row row-between-wrapper">
  324. <view>联系客服</view>
  325. <view class="iconfont icon-xiangyou"></view>
  326. </view>
  327. </button>
  328. <!-- #endif -->
  329. <!-- #ifdef APP-PLUS -->
  330. <view class="item acea-row row-between-wrapper" hover-class="none"
  331. @click="goMenuPage('/pages/users/privacy/index')">
  332. <image src="/static/images/menu.png"></image>
  333. <view class="text acea-row row-between-wrapper">
  334. <view>隐私协议</view>
  335. <view class="iconfont icon-xiangyou"></view>
  336. </view>
  337. </view>
  338. <!-- #endif -->
  339. </view>
  340. <!-- 会员菜单一 -->
  341. <view class="user-menus" style="margin-top: 25rpx;" v-if="menu_status == 1 && MyMenus.length">
  342. <view class="menu-title">我的服务</view>
  343. <view class="list-box">
  344. <!-- #ifdef APP-PLUS || H5 -->
  345. <block v-for="(item,index) in MyMenus" :key="index">
  346. <view class="item" v-if="item.url!='#' && item.url!='/pages/service/index'"
  347. @click="goMenuPage(item.url, item.name)">
  348. <image :src="item.pic"></image>
  349. <text>{{item.name}}</text>
  350. </view>
  351. </block>
  352. <!-- #endif -->
  353. <!-- #ifdef MP -->
  354. <block v-for="(item,index) in MyMenus" :key="index">
  355. <view class="item" v-if="item.url!='#'
  356. && item.url!='/pages/service/index'
  357. && item.url!='/pages/extension/customer_list/chat'
  358. || (item.url=='/pages/extension/customer_list/chat' && routineContact == 0)"
  359. @click="goMenuPage(item.url, item.name)">
  360. <image :src="item.pic"></image>
  361. <text>{{item.name}}</text>
  362. </view>
  363. </block>
  364. <button class="item" open-type='contact' v-if="routineContact == 1">
  365. <image src="/static/images/contact.png"></image>
  366. <text>联系客服</text>
  367. </button>
  368. <!-- #endif -->
  369. <!-- #ifdef APP-PLUS -->
  370. <view class="item" hover-class="none" @click="goMenuPage('/pages/users/privacy/index?type=privacy')">
  371. <image src="/static/images/menu.png"></image>
  372. <text>隐私协议</text>
  373. </view>
  374. <!-- #endif -->
  375. </view>
  376. </view>
  377. <view class="user-menus" style="margin-top: 25rpx;" v-if="service_status == 1 && storeMenu.length">
  378. <view class="menu-title">商家管理</view>
  379. <view class="list-box">
  380. <block v-for="(item,index) in storeMenu" :key="index">
  381. <view class="item" :url="item.url" v-if="item.url!='#' && item.url!='/pages/service/index'"
  382. @click="goMenuPage(item.url, item.name)">
  383. <image :src="item.pic"></image>
  384. <text>{{item.name}}</text>
  385. </view>
  386. </block>
  387. </view>
  388. </view>
  389. <view class="menus-list" v-if="service_status == 2 && storeMenu.length">
  390. <view class="title">商家管理</view>
  391. <block v-for="(item,index) in storeMenu" :key="index">
  392. <view class="item acea-row row-between-wrapper" :url="item.url" hover-class="none"
  393. v-if="item.url!='#' && item.url!='/pages/service/index'" @click="goMenuPage(item.url, item.name)">
  394. <image :src="item.pic"></image>
  395. <view class="text acea-row row-between-wrapper">
  396. <view>{{item.name}}</view>
  397. <view class="iconfont icon-xiangyou"></view>
  398. </view>
  399. </view>
  400. </block>
  401. </view>
  402. <view class="copy_right">
  403. <template v-if='copyRightText'>
  404. <image :src="copyRightImg" mode="" class="copyRightImg"></image>
  405. <view class="copyRightText">
  406. {{copyRightText}}
  407. </view>
  408. </template>
  409. <image v-else src="/static/images/support.png" alt="" class='support'></image>
  410. </view>
  411. <view class="uni-p-b-98"></view>
  412. </scroll-view>
  413. </view>
  414. <view class="codePopup" :style="colorStyle" v-show="isCode">
  415. <view class="header acea-row row-between-wrapper">
  416. <view class="title" :class="{'on': codeIndex == index,'onLeft':codeIndex == 1}"
  417. v-for="(item, index) in codeList" :key="index" @click="tapCode(index)">{{item.name}}</view>
  418. </view>
  419. <view>
  420. <view class="acea-row row-center-wrapper">
  421. <w-barcode :options="config.bar"></w-barcode>
  422. </view>
  423. <view class="acea-row row-center-wrapper" style="margin-top: 35rpx;">
  424. <w-qrcode :options="config.qrc" @generate="hello"></w-qrcode>
  425. </view>
  426. <view class="codeNum">{{config.bar.code}}</view>
  427. <view class="tip">如遇到扫码失败请将屏幕调至最亮重新扫码</view>
  428. </view>
  429. <view class="iconfont icon-guanbi2" @click="closeCode"></view>
  430. </view>
  431. <view class="mark" v-if="isCode"></view>
  432. <pageFooter></pageFooter>
  433. <!-- 店员推广码 extension-->
  434. <view class="codePopup heg" :style="colorStyle" v-show="isextension">
  435. <view class="header">
  436. <view class="title on" style="width: 100%;">店员推广码</view>
  437. </view>
  438. <view>
  439. <view class="acea-row row-center-wrapper" style="margin-top: 25rpx;" @click="hah">
  440. <w-qrcode id="hah" :options="extension"></w-qrcode>
  441. </view>
  442. <view class="tip">如遇到扫码失败请将屏幕调至最亮重新扫码</view>
  443. </view>
  444. <view class="iconfont icon-guanbi2" @click="closeCode"></view>
  445. </view>
  446. <view class="mark" v-show="isextension"></view>
  447. <ewcomerPop v-if="isComerGift" :comerGift="comerGift" @comerPop="comerPop"></ewcomerPop>
  448. </view>
  449. </template>
  450. <script>
  451. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  452. import {
  453. storeCardApi
  454. } from '@/api/store.js';
  455. import {
  456. newcomerGift
  457. } from '@/api/new_store.js';
  458. import {
  459. newcomerList
  460. } from '@/api/api.js';
  461. import {
  462. getMenuList,
  463. getUserInfo,
  464. setVisit,
  465. updateUserInfo,
  466. getRandCode,
  467. updateWechatInfo
  468. } from '@/api/user.js';
  469. import {
  470. wechatAuthV2,
  471. silenceAuth
  472. } from '@/api/public.js'
  473. import {
  474. toLogin
  475. } from '@/libs/login.js';
  476. import {
  477. mapState,
  478. mapGetters
  479. } from "vuex";
  480. // #ifdef H5
  481. import Auth from '@/libs/wechat';
  482. // #endif
  483. import {
  484. HTTP_REQUEST_URL
  485. } from '@/config/app';
  486. const app = getApp();
  487. import ewcomerPop from '@/components/ewcomerPop/index.vue'
  488. import pageFooter from '@/components/pageFooter/index.vue'
  489. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  490. import Routine from '@/libs/routine';
  491. import colors from '@/mixins/color';
  492. export default {
  493. components: {
  494. pageFooter,
  495. ewcomerPop
  496. },
  497. computed: {
  498. ...mapGetters({
  499. cartNum: 'cartNum',
  500. isLogin: 'isLogin'
  501. })
  502. },
  503. filters: {
  504. coundTime(val) {
  505. var setTime = val * 1000
  506. var nowTime = new Date()
  507. var rest = setTime - nowTime.getTime()
  508. var day = parseInt(rest / (60 * 60 * 24 * 1000))
  509. // var hour = parseInt(rest/(60*60*1000)%24) //小时
  510. return day + '天'
  511. },
  512. dateFormat: function(value) {
  513. return dayjs(value * 1000).format('YYYY-MM-DD');
  514. }
  515. },
  516. mixins: [colors],
  517. data() {
  518. return {
  519. vipStatus: 0,
  520. stu: false,
  521. storeMenu: [], // 商家管理
  522. orderMenu: [{
  523. img: 'icon-daifukuan',
  524. title: '待付款',
  525. url: '/pages/goods/order_list/index?status=0'
  526. },
  527. {
  528. img: 'icon-daifahuo',
  529. title: '待发货',
  530. url: '/pages/goods/order_list/index?status=1'
  531. },
  532. {
  533. img: 'icon-daishouhuo',
  534. title: '待收货',
  535. url: '/pages/goods/order_list/index?status=2'
  536. },
  537. {
  538. img: 'icon-daipingjia',
  539. title: '待评价',
  540. url: '/pages/goods/order_list/index?status=3'
  541. },
  542. {
  543. img: 'icon-a-shouhoutuikuan',
  544. title: '售后/退款',
  545. url: '/pages/users/user_return_list/index'
  546. },
  547. ],
  548. imgUrls: [],
  549. autoplay: true,
  550. circular: true,
  551. interval: 3000,
  552. duration: 500,
  553. isAuto: false, //没有授权的不会自动授权
  554. isShowAuth: false, //是否隐藏授权
  555. orderStatusNum: {},
  556. userInfo: {},
  557. MyMenus: [],
  558. sysHeight: sysHeight,
  559. mpHeight: 0,
  560. showStatus: 1,
  561. // #ifdef H5 || MP
  562. pageHeight: '100%',
  563. routineContact: 0,
  564. // #endif
  565. // #ifdef APP-PLUS
  566. pageHeight: app.globalData.windowHeight,
  567. // #endif
  568. // #ifdef H5
  569. isWeixin: Auth.isWeixin(),
  570. //#endif
  571. footerSee: false,
  572. member_style: 1,
  573. my_banner_status: 1,
  574. menu_status: 1,
  575. service_status: 1,
  576. codeList: [{
  577. name: '会员码'
  578. }, {
  579. name: '付款码'
  580. }],
  581. codeIndex: 0,
  582. config: {
  583. bar: {
  584. code: '',
  585. color: ['#000'],
  586. bgColor: '#FFFFFF', // 背景色
  587. width: 480, // 宽度
  588. height: 110 // 高度
  589. },
  590. qrc: {
  591. code: '',
  592. size: 380, // 二维码大小
  593. level: 3, //等级 0~4
  594. bgColor: '#FFFFFF', //二维码背景色 默认白色
  595. border: {
  596. color: ['#eee', '#eee'], //边框颜色支持渐变色
  597. lineWidth: 3, //边框宽度
  598. },
  599. // img: '/static/logo.png', //图片
  600. // iconSize: 40, //二维码图标的大小
  601. color: ['#333', '#333'], //边框颜色支持渐变色
  602. }
  603. },
  604. isCode: false,
  605. isextension: false,
  606. extension: {
  607. code: "",
  608. size: 380, // 二维码大小
  609. level: 3, //等级 0~4
  610. bgColor: '#FFFFFF', //二维码背景色 默认白色
  611. border: {
  612. color: ['#eee', '#eee'], //边框颜色支持渐变色
  613. lineWidth: 3, //边框宽度
  614. },
  615. // img: '/static/logo.png', //图片
  616. // iconSize: 40, //二维码图标的大小
  617. color: ['#333', '#333'], //边框颜色支持渐变色
  618. },
  619. imgHost: HTTP_REQUEST_URL,
  620. copyRightText: "",
  621. copyRightImg: '',
  622. giftPic:'',
  623. vip_type:1,
  624. newcomer_style:1,
  625. newList:[],
  626. newBg:'',
  627. comerGift:{},
  628. isComerGift:false,
  629. memberStatus:0
  630. }
  631. },
  632. created() {
  633. let that = this;
  634. // #ifdef MP
  635. // 小程序静默授权
  636. if (!this.$store.getters.isLogin) {
  637. Routine.getCode()
  638. .then(code => {
  639. Routine.silenceAuth(code).then(res => {
  640. this.onLoadFun();
  641. })
  642. })
  643. .catch(res => {
  644. uni.hideLoading();
  645. });
  646. }
  647. // #endif
  648. // #ifdef H5 || APP-PLUS
  649. if (that.isLogin == false) {
  650. toLogin()
  651. }
  652. // #endif
  653. // #ifdef APP-PLUS
  654. that.$set(that, 'pageHeight', app.globalData.windowHeight);
  655. // #endif
  656. },
  657. async onLoad(option) {
  658. if(this.isLogin){
  659. this.getNewcomerGift();
  660. }
  661. // #ifdef H5
  662. if (this.isLogin && Auth.isWeixin() && option.code) {
  663. try {
  664. let res = await updateWechatInfo({
  665. code: option.code
  666. });
  667. this.userInfo.nickname = res.data.nickname;
  668. this.userInfo.avatar = res.data.avatar;
  669. this.userInfo.is_complete = 1;
  670. } catch (e) {}
  671. }
  672. // #endif
  673. this.getNewList();
  674. this.colorData();
  675. let giftList = [
  676. this.imgHost+'/statics/images/gift01.png',
  677. this.imgHost+'/statics/images/gift02.png',
  678. this.imgHost+'/statics/images/gift03.png',
  679. this.imgHost+'/statics/images/gift04.png',
  680. this.imgHost+'/statics/images/gift05.png'
  681. ];
  682. let newBg = [
  683. this.imgHost+'/statics/images/blue-bg.png',
  684. this.imgHost+'/statics/images/green-bg.png',
  685. this.imgHost+'/statics/images/red-bg.png',
  686. this.imgHost+'/statics/images/pink-bg.png',
  687. this.imgHost+'/statics/images/orange-bg.png'
  688. ]
  689. setTimeout(()=>{
  690. switch(this.colorNum){
  691. case 1:
  692. this.giftPic = giftList[2];
  693. this.newBg = newBg[0];
  694. break;
  695. case 2:
  696. this.giftPic = giftList[1];
  697. this.newBg = newBg[1];
  698. break;
  699. case 3:
  700. this.giftPic = giftList[4];
  701. this.newBg = newBg[2];
  702. break;
  703. case 4:
  704. this.giftPic = giftList[0];
  705. this.newBg = newBg[3];
  706. break;
  707. case 5:
  708. this.giftPic = giftList[3];
  709. this.newBg = newBg[4];
  710. break;
  711. default:
  712. this.giftPic = giftList[4];
  713. this.newBg = newBg[2];
  714. break
  715. }
  716. },1)
  717. },
  718. onReady() {
  719. let self = this
  720. // #ifdef MP
  721. let info = uni.createSelectorQuery().select(".sys-head");
  722. info.boundingClientRect(function(data) { //data - 各种参数
  723. self.mpHeight = data.height
  724. }).exec()
  725. // #endif
  726. },
  727. onShow: function() {
  728. if (this.cartNum > 0) {
  729. uni.setTabBarBadge({
  730. index: 3,
  731. text: this.cartNum + ''
  732. })
  733. } else {
  734. uni.hideTabBarRedDot({
  735. index: 3
  736. })
  737. }
  738. this.copyRightText = uni.getStorageSync('copyNameInfo');
  739. this.copyRightImg = uni.getStorageSync('copyImageInfo');
  740. uni.removeStorageSync('form_type_cart');
  741. let that = this;
  742. // #ifdef APP-PLUS
  743. uni.getSystemInfo({
  744. success: function(res) {
  745. that.pageHeight = res.windowHeight + 'px'
  746. }
  747. });
  748. // #endif
  749. if (that.isLogin) {
  750. this.getUserInfo();
  751. this.getMyMenus();
  752. this.setVisit();
  753. };
  754. },
  755. methods: {
  756. goDetail(item){
  757. uni.navigateTo({
  758. url: `/pages/goods_details/index?id=${item.id}&fromPage='newVip'`
  759. });
  760. },
  761. comerPop(){
  762. this.isComerGift = false;
  763. },
  764. getNewcomerGift(){
  765. if(uni.getStorageSync('newcomerGift')){
  766. return this.isComerGift = false;
  767. }
  768. newcomerGift().then(res=>{
  769. this.comerGift = res.data;
  770. if(Object.prototype.toString.call(this.comerGift) == '[object Object]'){
  771. if(res.data.coupon_count || res.data.product_count || res.data.register_give_money || res.data.first_oder_discount || res.data.register_give_integral){
  772. uni.setStorageSync('newcomerGift', true);
  773. this.isComerGift = true;
  774. }
  775. }
  776. }).catch(err=>{
  777. return this.$util.Tips({
  778. title: err
  779. });
  780. })
  781. },
  782. getNewList(){
  783. newcomerList({
  784. page: 1,
  785. limit: 6,
  786. priceOrder: '',
  787. salesOrder: ''
  788. }).then(res=>{
  789. this.newList = res.data;
  790. }).catch(err=>{
  791. return this.$util.Tips({
  792. title: err
  793. });
  794. })
  795. },
  796. hah() {
  797. let that = this
  798. // #ifdef H5
  799. var canvas = document.getElementById("hah").getElementsByTagName("canvas")
  800. var imgURL = canvas[0].toDataURL("image/png")
  801. var dlLink = document.createElement('a');
  802. dlLink.download = "店员推广码";
  803. dlLink.href = imgURL;
  804. dlLink.dataset.downloadurl = ["image/png", dlLink.download, dlLink.href].join(':');
  805. document.body.appendChild(dlLink);
  806. dlLink.click();
  807. document.body.removeChild(dlLink);
  808. // #endif
  809. // #ifdef MP
  810. // let ctx = uni.createCanvasContext("WQrcode")
  811. // let ctx = uni.createSelectorQuery().in(this).select("canvas")
  812. // uni.canvasToTempFilePath({
  813. // canvasId: "WQrcode",
  814. // fileType: 'image/png',
  815. // success: (res) => {
  816. // // 保存当前绘制推广码
  817. // that.savePic(res.tempFilePath)
  818. // },
  819. // fail: function(err) {
  820. // console.log(err, '推广码生成失败')
  821. // }
  822. // },that)
  823. // ctx.draw(false, uni.canvasToTempFilePath({
  824. // canvasId: 'WQrcode',
  825. // success: function (res) {
  826. // that.savePic(res.tempFilePath)
  827. // },
  828. // fail: function (err) {
  829. // console.log(err, '推广码生成失败')
  830. // }
  831. // },that))
  832. // console.log("222222",ctx)
  833. // #endif
  834. // #ifdef APP-PLUS
  835. uni.canvasToTempFilePath({
  836. canvasId: 'WQrcode',
  837. success: (res) => {
  838. uni.hideLoading()
  839. // 保存当前绘制推广码
  840. that.savePic(res.tempFilePath)
  841. },
  842. fail: function(err) {
  843. console.log(err, '推广码生成失败')
  844. }
  845. })
  846. // #endif
  847. },
  848. //保存推广码到本地
  849. savePic(filePath) {
  850. // #ifdef APP-PLUS
  851. uni.showLoading({
  852. title: '正在保存'
  853. });
  854. uni.saveImageToPhotosAlbum({
  855. filePath: filePath,
  856. success: function() {
  857. uni.showToast({
  858. title: '推广码保存成功~'
  859. });
  860. },
  861. fail: function(e) {
  862. console.log(e, '推广码保存失败')
  863. },
  864. complete: function() {
  865. uni.hideLoading()
  866. }
  867. });
  868. // #endif
  869. },
  870. hello(res) {
  871. // console.log(321,res)
  872. },
  873. // 前往新人专享
  874. goNewcomers() {
  875. uni.navigateTo({
  876. url:'/pages/store/newcomers/index'
  877. })
  878. },
  879. getCode() {
  880. getRandCode().then(res => {
  881. let code = res.data.code;
  882. this.config.bar.code = code;
  883. this.config.qrc.code = code;
  884. }).catch(err => {
  885. return this.$util.Tips(err);
  886. })
  887. },
  888. tapQrCode() {
  889. this.isCode = true;
  890. this.codeIndex = 0;
  891. this.$nextTick(function() {
  892. let code = this.userInfo.bar_code;
  893. this.config.bar.code = code;
  894. this.config.qrc.code = code;
  895. })
  896. },
  897. closeCode() {
  898. this.isCode = false
  899. this.isextension = false
  900. },
  901. tapCode(index) {
  902. this.codeIndex = index;
  903. if (index == 1) {
  904. this.getCode();
  905. } else {
  906. let code = this.userInfo.bar_code;
  907. this.config.bar.code = code;
  908. this.config.qrc.code = code;
  909. }
  910. },
  911. getWechatuserinfo() {
  912. //#ifdef H5
  913. Auth.isWeixin() && Auth.toAuth('snsapi_userinfo', '/pages/user/index');
  914. //#endif
  915. },
  916. getRoutineUserInfo(e) {
  917. updateUserInfo({
  918. userInfo: e.detail.userInfo
  919. }).then(res => {
  920. this.getUserInfo();
  921. return this.$util.Tips('更新用户信息成功');
  922. }).catch(err => {
  923. return this.$util.Tips(err);
  924. })
  925. },
  926. // 记录会员访问
  927. setVisit() {
  928. setVisit({
  929. url: '/pages/user/index'
  930. }).then(res => {})
  931. },
  932. // 打开授权
  933. openAuto() {
  934. toLogin();
  935. },
  936. // 授权回调
  937. onLoadFun() {
  938. this.getUserInfo();
  939. this.getMyMenus();
  940. this.setVisit();
  941. },
  942. Setting: function() {
  943. uni.openSetting({
  944. success: function(res) {}
  945. });
  946. },
  947. // 授权关闭
  948. authColse: function(e) {
  949. this.isShowAuth = e
  950. },
  951. // 绑定手机
  952. bindPhone() {
  953. uni.navigateTo({
  954. url: '/pages/users/user_phone/index'
  955. })
  956. },
  957. /**
  958. * 获取个人用户信息
  959. */
  960. getUserInfo: function() {
  961. let that = this;
  962. getUserInfo().then(res => {
  963. that.userInfo = res.data
  964. that.stu = res.data.svip_open
  965. that.memberStatus = parseInt(res.data.member_func_status)
  966. that.vipStatus = res.data.vip_status
  967. that.$store.commit("SETUID", res.data.uid);
  968. that.$store.commit("UPDATE_USERINFO", res.data);
  969. that.orderMenu.forEach((item, index) => {
  970. switch (item.title) {
  971. case '待付款':
  972. item.num = res.data.orderStatusNum.unpaid_count
  973. break
  974. case '待发货':
  975. item.num = res.data.orderStatusNum.unshipped_count
  976. break
  977. case '待收货':
  978. item.num = res.data.orderStatusNum.received_count
  979. break
  980. case '待评价':
  981. item.num = res.data.orderStatusNum.evaluated_count
  982. break
  983. case '售后/退款':
  984. item.num = res.data.orderStatusNum.refunding_count
  985. break
  986. }
  987. })
  988. });
  989. },
  990. //小程序授权api替换 getUserInfo
  991. getUserProfile() {
  992. uni.showLoading({
  993. title: '获取中'
  994. });
  995. let self = this;
  996. Routine.getUserProfile()
  997. .then(res => {
  998. Routine.getCode()
  999. .then(code => {
  1000. let userInfo = res.userInfo;
  1001. userInfo.code = code;
  1002. userInfo.spread_spid = app.globalData.spid; //获取推广人ID
  1003. userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID
  1004. Routine.authUserInfo(userInfo)
  1005. .then(res => {
  1006. if (res.data.key !== undefined && res.data.key) {
  1007. uni.hideLoading();
  1008. self.authKey = res.data.key;
  1009. self.isPhoneBox = true;
  1010. } else {
  1011. uni.hideLoading();
  1012. let time = res.data.expires_time - self.$Cache.time();
  1013. self.$store.commit('LOGIN', {
  1014. token: res.data.token,
  1015. time: time
  1016. });
  1017. this.getUserInfo()
  1018. }
  1019. })
  1020. .catch(res => {
  1021. uni.hideLoading();
  1022. uni.showToast({
  1023. title: res.msg,
  1024. icon: 'none',
  1025. duration: 2000
  1026. });
  1027. });
  1028. })
  1029. .catch(res => {
  1030. uni.hideLoading();
  1031. });
  1032. })
  1033. .catch(res => {
  1034. uni.hideLoading();
  1035. });
  1036. },
  1037. /**
  1038. *
  1039. * 获取个人中心图标
  1040. */
  1041. switchTab(order) {
  1042. this.orderMenu.forEach((item, index) => {
  1043. switch (item.title) {
  1044. case '待付款':
  1045. item.img = order.dfk
  1046. break
  1047. case '待发货':
  1048. item.img = order.dfh
  1049. break
  1050. case '待收货':
  1051. item.img = order.dsh
  1052. break
  1053. case '待评价':
  1054. item.img = order.dpj
  1055. break
  1056. case '售后/退款':
  1057. item.img = order.sh
  1058. break
  1059. }
  1060. })
  1061. },
  1062. getMyMenus: function() {
  1063. let that = this;
  1064. // if (this.MyMenus.length) return;
  1065. getMenuList().then(res => {
  1066. let storeMenu = []
  1067. let myMenu = []
  1068. res.data.routine_my_menus.forEach((el, index, arr) => {
  1069. if (el.type == '2') {
  1070. storeMenu.push(el)
  1071. } else {
  1072. myMenu.push(el)
  1073. }
  1074. })
  1075. this.member_style = Number(res.data.diy_data.status)
  1076. this.my_banner_status = res.data.diy_data.my_banner_status
  1077. this.menu_status = res.data.diy_data.menu_status
  1078. this.service_status = res.data.diy_data.service_status
  1079. this.vip_type = res.data.diy_data.vip_type;
  1080. this.newcomer_style = res.data.diy_data.newcomer_style;
  1081. let order01 = {
  1082. dfk: 'icon-daifukuan',
  1083. dfh: 'icon-daifahuo',
  1084. dsh: 'icon-daishouhuo',
  1085. dpj: 'icon-daipingjia',
  1086. sh: 'icon-a-shouhoutuikuan'
  1087. }
  1088. let order02 = {
  1089. dfk: 'icon-daifukuan-lan',
  1090. dfh: 'icon-daifahuo-lan',
  1091. dsh: 'icon-daishouhuo-lan',
  1092. dpj: 'icon-daipingjia-lan',
  1093. sh: 'icon-shouhou-tuikuan-lan'
  1094. }
  1095. let order03 = {
  1096. dfk: 'icon-daifukuan-ju',
  1097. dfh: 'icon-daifahuo-ju',
  1098. dsh: 'icon-daishouhuo-ju',
  1099. dpj: 'icon-daipingjia-ju',
  1100. sh: 'icon-shouhou-tuikuan-ju'
  1101. }
  1102. let order04 = {
  1103. dfk: 'icon-daifukuan-fen',
  1104. dfh: 'icon-daifahuo-fen',
  1105. dsh: 'icon-daishouhuo-fen',
  1106. dpj: 'icon-daipingjia-fen',
  1107. sh: 'icon-a-shouhoutuikuan-fen'
  1108. }
  1109. let order05 = {
  1110. dfk: 'icon-daifukuan-lv',
  1111. dfh: 'icon-daifahuo-lv',
  1112. dsh: 'icon-daishouhuo-lv',
  1113. dpj: 'icon-daipingjia-lv',
  1114. sh: 'icon-shouhou-tuikuan-lv'
  1115. }
  1116. switch (res.data.diy_data.order_status) {
  1117. case 1:
  1118. this.switchTab(order01)
  1119. break
  1120. case 2:
  1121. this.switchTab(order02)
  1122. break
  1123. case 3:
  1124. this.switchTab(order03)
  1125. break
  1126. case 4:
  1127. this.switchTab(order04)
  1128. break
  1129. case 5:
  1130. this.switchTab(order05)
  1131. break
  1132. }
  1133. that.$set(that, 'MyMenus', myMenu);
  1134. that.$set(that, 'storeMenu', storeMenu);
  1135. this.imgUrls = res.data.routine_my_banner
  1136. this.routineContact = Number(res.data.routine_contact_type)
  1137. });
  1138. },
  1139. // 编辑页面
  1140. goEdit() {
  1141. if (this.isLogin == false) {
  1142. toLogin();
  1143. } else {
  1144. uni.navigateTo({
  1145. url: '/pages/users/user_info/index'
  1146. })
  1147. }
  1148. },
  1149. // 签到
  1150. goSignIn() {
  1151. uni.navigateTo({
  1152. url: '/pages/users/user_sgin/index'
  1153. })
  1154. },
  1155. goMenuPage(url, name) {
  1156. if (this.isLogin) {
  1157. if (url == '/pages/extension/customer_list/chat' || url == 'https://chat.crmeb.net/chat/mobile') {
  1158. this.$util.getCustomer(this.userInfo)
  1159. } else {
  1160. if (url.indexOf('http') === -1) {
  1161. // #ifdef H5
  1162. if (name && name === '订单核销') {
  1163. return window.location.href = `${location.origin}${url}`
  1164. }
  1165. // #endif
  1166. // #ifdef MP
  1167. if (url != '#' && url == '/pages/users/user_info/index') {
  1168. uni.openSetting({
  1169. success: function(res) {}
  1170. });
  1171. }
  1172. // #endif
  1173. if (url == '/pages/store_spread/index') {
  1174. storeCardApi().then(res => {
  1175. this.isextension = true
  1176. this.$nextTick(function() {
  1177. this.extension.code = res.data.url
  1178. })
  1179. }).catch(err => {
  1180. uni.hideLoading()
  1181. this.$util.Tips({
  1182. title: err
  1183. })
  1184. })
  1185. }
  1186. uni.navigateTo({
  1187. url: url
  1188. })
  1189. } else {
  1190. uni.navigateTo({
  1191. url: `/pages/annex/web_view/index?url=${url}`
  1192. });
  1193. }
  1194. }
  1195. } else {
  1196. // #ifdef MP
  1197. this.openAuto()
  1198. // #endif
  1199. }
  1200. }
  1201. }
  1202. }
  1203. </script>
  1204. <style lang="scss">
  1205. .style-add {
  1206. flex: 1;
  1207. overflow: hidden;
  1208. }
  1209. .height-add {
  1210. height: 100%;
  1211. }
  1212. .display-add {
  1213. height: 100%;
  1214. display: flex;
  1215. align-items: center;
  1216. }
  1217. page,
  1218. body {
  1219. height: 100%;
  1220. }
  1221. .heg {
  1222. height: 670rpx !important;
  1223. }
  1224. .mark {
  1225. position: fixed;
  1226. top: 0;
  1227. left: 0;
  1228. bottom: 0;
  1229. right: 0;
  1230. background: rgba(0, 0, 0, 0.5);
  1231. z-index: 30;
  1232. }
  1233. .height { margin-top: -84rpx !important; }
  1234. .menus-list {
  1235. width: 690rpx;
  1236. background-color: #fff;
  1237. border-radius: 14rpx;
  1238. margin: 25rpx auto 0 auto;
  1239. .title {
  1240. font-weight: 600;
  1241. font-size: 30rpx;
  1242. color: #333;
  1243. padding: 30rpx 30rpx 10rpx 30rpx;
  1244. }
  1245. .item {
  1246. margin-left: 30rpx;
  1247. font-size: 30rpx;
  1248. color: #333;
  1249. image {
  1250. width: 42rpx;
  1251. height: 42rpx;
  1252. display: block;
  1253. }
  1254. .text {
  1255. width: 590rpx;
  1256. border-bottom: 1rpx solid #EEEEEE;
  1257. padding: 28rpx 30rpx 28rpx 0;
  1258. .iconfont {
  1259. font-size: 20rpx;
  1260. color: #8A8A8A;
  1261. }
  1262. }
  1263. }
  1264. }
  1265. .num-wrapper {
  1266. background-color: #fff;
  1267. z-index: 29;
  1268. position: relative;
  1269. display: flex;
  1270. align-items: center;
  1271. justify-content: space-between;
  1272. margin-top: 22rpx;
  1273. color: #333;
  1274. margin: 30rpx 30rpx 25rpx 30rpx;
  1275. border-radius: 16rpx;
  1276. height: 160rpx;
  1277. &.on{
  1278. height: 128rpx;
  1279. margin-top: -68rpx;
  1280. .gift{
  1281. color: var(--view-theme);
  1282. margin-left: 10rpx;
  1283. font-weight: bold;
  1284. }
  1285. }
  1286. .img {
  1287. margin-left: 38rpx;
  1288. width: 76rpx;
  1289. height: 68rpx;
  1290. }
  1291. .text {
  1292. font-size: 28rpx;
  1293. font-weight: 400;
  1294. color: #333333;
  1295. margin-left: -60rpx;
  1296. }
  1297. .btn-login {
  1298. width: 144rpx;
  1299. height: 56rpx;
  1300. // background: linear-gradient(270deg, #FF7931 0%, #E93323 100%);
  1301. background-color: var(--view-theme);
  1302. border-radius: 28rpx;
  1303. text-align: center;
  1304. line-height: 56rpx;
  1305. margin-right: 32rpx;
  1306. font-size: 28rpx;
  1307. font-weight: 500;
  1308. color: #FFFFFF;
  1309. }
  1310. .num-item {
  1311. width: 33.33%;
  1312. text-align: center;
  1313. &~.num-item {
  1314. position: relative;
  1315. &:before {
  1316. content: '';
  1317. position: absolute;
  1318. width: 1rpx;
  1319. height: 28rpx;
  1320. top: 50%;
  1321. margin-top: -14rpx;
  1322. background-color: rgba(255, 255, 255, 0.4);
  1323. left: 0;
  1324. }
  1325. }
  1326. .num {
  1327. font-size: 36rpx;
  1328. font-weight: bold;
  1329. }
  1330. .txt {
  1331. margin-top: 8rpx;
  1332. font-size: 26rpx;
  1333. color: #555;
  1334. }
  1335. }
  1336. }
  1337. // 新人专享
  1338. .newcomersCon{
  1339. background-color: var(--view-theme);
  1340. width: 690rpx;
  1341. height: 296rpx;
  1342. margin: 0 30rpx;
  1343. border-radius: 16rpx;
  1344. &.on{
  1345. background-color: #fff;
  1346. .newcomers{
  1347. .title{
  1348. .tl{
  1349. color: #333;
  1350. }
  1351. .tr{
  1352. width: unset;
  1353. color: #666666;
  1354. background: unset;
  1355. }
  1356. }
  1357. .scroll{
  1358. .scroll-item{
  1359. background-color: var(--view-minorColorT);
  1360. }
  1361. }
  1362. }
  1363. }
  1364. .newcomers {
  1365. padding: 24rpx 30rpx;
  1366. width: 100%;
  1367. height: 100%;
  1368. background-repeat: no-repeat;
  1369. background-size: 100% 100%;
  1370. .title {
  1371. display: flex;
  1372. justify-content: space-between;
  1373. .tl {
  1374. font-size: 30rpx;
  1375. font-weight: 600;
  1376. color: #FFFFFF;
  1377. }
  1378. .tr {
  1379. width: 90rpx;
  1380. height: 36rpx;
  1381. background: linear-gradient(135deg, #FFCA52 0%, #FE960F 100%);
  1382. border-radius: 18rpx;
  1383. font-size: 24rpx;
  1384. text-align: center;
  1385. line-height: 36rpx;
  1386. font-weight: 400;
  1387. color: #FFFFFF;
  1388. .icon-xiangyou {
  1389. font-size: 16rpx;
  1390. }
  1391. }
  1392. }
  1393. .scroll {
  1394. width: 690rpx;
  1395. margin-top: 20rpx;
  1396. white-space: nowrap;
  1397. padding-right: 60rpx;
  1398. .scroll-item {
  1399. display: inline-block;
  1400. width: 162rpx;
  1401. height: 194rpx;
  1402. background-color: #fff;
  1403. border-radius: 12rpx;
  1404. margin-right: 10rpx;
  1405. padding: 12rpx;
  1406. .pictrue{
  1407. width: 138rpx;
  1408. height: 138rpx;
  1409. position: relative;
  1410. image{
  1411. width: 100%;
  1412. height: 100%;
  1413. }
  1414. .label{
  1415. width: 98rpx;
  1416. height: 32rpx;
  1417. background: var(--view-theme);
  1418. border-radius: 16rpx;
  1419. color: #FFFFFF;
  1420. font-size: 24rpx;
  1421. text-align: center;
  1422. line-height: 32rpx;
  1423. position: absolute;
  1424. bottom: 2rpx;
  1425. left:50%;
  1426. margin-left: -49rpx;
  1427. }
  1428. }
  1429. .money{
  1430. font-size: 24rpx;
  1431. color: var(--view-priceColor);
  1432. margin-top: 6rpx;
  1433. }
  1434. }
  1435. }
  1436. }
  1437. }
  1438. .Tnum-wrapper {
  1439. margin: -34rpx 30rpx 25rpx 30rpx;
  1440. }
  1441. .unNum-wrapper {
  1442. margin: 0 30rpx 25rpx 30rpx;
  1443. }
  1444. .unBg {
  1445. background-color: unset !important;
  1446. .user-info {
  1447. .info {
  1448. .name {
  1449. color: #333333 !important;
  1450. font-weight: 600;
  1451. }
  1452. .num {
  1453. color: #333 !important;
  1454. .num-txt {
  1455. height: 38rpx;
  1456. background-color: rgba(51, 51, 51, 0.13);
  1457. padding: 0 12rpx;
  1458. border-radius: 16rpx;
  1459. }
  1460. }
  1461. }
  1462. }
  1463. .qrCode {
  1464. color: #333 !important;
  1465. }
  1466. .message {
  1467. .iconfont {
  1468. color: #333 !important;
  1469. }
  1470. .num {
  1471. color: #fff !important;
  1472. background-color: var(--view-theme) !important;
  1473. }
  1474. }
  1475. .setting {
  1476. .iconfont {
  1477. color: #333 !important;
  1478. }
  1479. }
  1480. }
  1481. .cardVipB {
  1482. background-color: #343A48;
  1483. width: 100%;
  1484. height: 124rpx;
  1485. border-radius: 16rpx 16rpx 0 0;
  1486. padding: 22rpx 30rpx 0 30rpx;
  1487. margin-top: 16px;
  1488. &.on{
  1489. width: 690rpx;
  1490. height: 130rpx;
  1491. background-repeat: no-repeat;
  1492. background-size: 100% 100%;
  1493. color: #fff;
  1494. margin-left: auto;
  1495. margin-right: auto;
  1496. padding: 22rpx 30rpx 0 90rpx;
  1497. .iconfont{
  1498. font-size: 24rpx;
  1499. margin-left: 6rpx;
  1500. }
  1501. }
  1502. .left-box {
  1503. .small {
  1504. color: #F8D5A8;
  1505. font-size: 28rpx;
  1506. margin-left: 18rpx;
  1507. }
  1508. .pictrue {
  1509. width: 40rpx;
  1510. height: 45rpx;
  1511. image {
  1512. width: 100%;
  1513. height: 100%;
  1514. }
  1515. }
  1516. }
  1517. .btn {
  1518. color: #BBBBBB;
  1519. font-size: 26rpx;
  1520. &.on{
  1521. color: #fff;
  1522. }
  1523. }
  1524. .icon-xiangyou {
  1525. margin-top: 6rpx;
  1526. }
  1527. }
  1528. .cardVipA {
  1529. position: absolute;
  1530. background-repeat: no-repeat;
  1531. background-size: 100% 100%;
  1532. width: 750rpx;
  1533. height: 84rpx;
  1534. bottom: -2rpx;
  1535. left: 0;
  1536. padding: 0 56rpx 0 135rpx;
  1537. .left-box {
  1538. font-size: 26rpx;
  1539. color: #905100;
  1540. font-weight: 400;
  1541. &.on{
  1542. color: #fff;
  1543. }
  1544. }
  1545. .btn {
  1546. color: #905100;
  1547. font-weight: 400;
  1548. font-size: 24rpx;
  1549. &.on{
  1550. color: #fff;
  1551. }
  1552. }
  1553. .iconfont {
  1554. font-size: 20rpx;
  1555. margin: 4rpx 0 0 4rpx;
  1556. &.on{
  1557. color: #fff;
  1558. margin-top: 0;
  1559. }
  1560. }
  1561. }
  1562. .new-users {
  1563. display: flex;
  1564. flex-direction: column;
  1565. height: 100%;
  1566. .sys-head {
  1567. position: relative;
  1568. width: 100%;
  1569. // background: linear-gradient(90deg, $bg-star1 0%, $bg-end1 100%);
  1570. .bg {
  1571. position: absolute;
  1572. left: 0;
  1573. top: 0;
  1574. width: 100%;
  1575. height: 100%;
  1576. // background: url("~@/static/images/user-sys.png") no-repeat;
  1577. background: var(--view-theme);
  1578. background-size: 100% auto;
  1579. background-position: left bottom;
  1580. }
  1581. .sys-title {
  1582. z-index: 10;
  1583. position: relative;
  1584. height: 43px;
  1585. text-align: center;
  1586. line-height: 43px;
  1587. font-size: 36rpx;
  1588. color: #FFFFFF;
  1589. }
  1590. }
  1591. .head {
  1592. // background: #fff;
  1593. .user-card {
  1594. position: relative;
  1595. width: 100%;
  1596. height: 270rpx;
  1597. margin: 0 auto;
  1598. padding: 35rpx 28rpx;
  1599. background-size: 100% auto;
  1600. background-color: var(--view-theme);
  1601. .user-info {
  1602. z-index: 20;
  1603. position: relative;
  1604. display: flex;
  1605. .headwear {
  1606. position: absolute;
  1607. right: -4rpx;
  1608. top: -14rpx;
  1609. width: 44rpx;
  1610. height: 44rpx;
  1611. image {
  1612. width: 100%;
  1613. height: 100%;
  1614. }
  1615. }
  1616. .live {
  1617. width: 28rpx;
  1618. height: 28rpx;
  1619. margin-left: 20rpx;
  1620. }
  1621. .bntImg {
  1622. width: 120rpx;
  1623. height: 120rpx;
  1624. border-radius: 50%;
  1625. text-align: center;
  1626. line-height: 120rpx;
  1627. background-color: unset;
  1628. position: relative;
  1629. .avatarName {
  1630. font-size: 16rpx;
  1631. color: #fff;
  1632. text-align: center;
  1633. background-color: rgba(0, 0, 0, 0.6);
  1634. height: 37rpx;
  1635. line-height: 37rpx;
  1636. position: absolute;
  1637. bottom: 0;
  1638. left: 0;
  1639. width: 100%;
  1640. }
  1641. }
  1642. .avatar-box {
  1643. position: relative;
  1644. display: flex;
  1645. align-items: center;
  1646. justify-content: center;
  1647. width: 120rpx;
  1648. height: 120rpx;
  1649. border-radius: 50%;
  1650. &.on {
  1651. .avatar {
  1652. border: 2px solid #FFAC65;
  1653. border-radius: 50%;
  1654. }
  1655. }
  1656. }
  1657. .avatar {
  1658. position: relative;
  1659. width: 120rpx;
  1660. height: 120rpx;
  1661. border-radius: 50%;
  1662. }
  1663. .info {
  1664. flex: 1;
  1665. display: flex;
  1666. flex-direction: column;
  1667. justify-content: space-between;
  1668. margin-left: 20rpx;
  1669. padding: 15rpx 0;
  1670. .name {
  1671. display: flex;
  1672. align-items: center;
  1673. color: #fff;
  1674. font-size: 31rpx;
  1675. .vip {
  1676. margin-left: 10rpx;
  1677. image {
  1678. width: 78rpx;
  1679. height: 30rpx;
  1680. display: block;
  1681. }
  1682. }
  1683. }
  1684. .num {
  1685. display: flex;
  1686. align-items: center;
  1687. font-size: 26rpx;
  1688. color: rgba(255, 255, 255, 0.6);
  1689. image {
  1690. width: 22rpx;
  1691. height: 23rpx;
  1692. margin-left: 20rpx;
  1693. }
  1694. }
  1695. }
  1696. }
  1697. .qrCode {
  1698. color: #fff;
  1699. margin-top: 16rpx !important;
  1700. font-size: 38rpx;
  1701. margin-right: 36rpx !important;
  1702. }
  1703. .message {
  1704. align-self: flex-start;
  1705. position: relative;
  1706. margin-top: 15rpx;
  1707. margin-right: 20rpx;
  1708. .num {
  1709. position: absolute;
  1710. top: -8rpx;
  1711. left: 18rpx;
  1712. padding: 0 6rpx;
  1713. height: 28rpx;
  1714. border-radius: 12rpx;
  1715. background-color: #fff;
  1716. font-size: 18rpx;
  1717. line-height: 28rpx;
  1718. text-align: center;
  1719. color: var(--view-theme);
  1720. }
  1721. .iconfont {
  1722. font-size: 40rpx;
  1723. color: #fff;
  1724. }
  1725. }
  1726. .sign {
  1727. z-index: 200;
  1728. position: absolute;
  1729. right: -12rpx;
  1730. top: 80rpx;
  1731. display: flex;
  1732. align-items: center;
  1733. justify-content: center;
  1734. width: 120rpx;
  1735. height: 60rpx;
  1736. background: linear-gradient(90deg, rgba(255, 225, 87, 1) 0%, rgba(238, 193, 15, 1) 100%);
  1737. border-radius: 29rpx 4rpx 4rpx 29rpx;
  1738. color: #282828;
  1739. font-size: 28rpx;
  1740. font-weight: bold;
  1741. }
  1742. }
  1743. .order-wrapper {
  1744. background: #fff;
  1745. margin: 0 30rpx;
  1746. border-radius: 16rpx;
  1747. position: relative;
  1748. .order-hd {
  1749. justify-content: space-between;
  1750. padding: 30rpx 20rpx 10rpx;
  1751. margin-top: 25rpx;
  1752. font-size: 30rpx;
  1753. color: #282828;
  1754. .left {
  1755. font-weight: bold;
  1756. }
  1757. .right {
  1758. align-items: center;
  1759. color: #666666;
  1760. font-size: 26rpx;
  1761. .icon-xiangyou {
  1762. margin-left: 5rpx;
  1763. margin-top: 6rpx;
  1764. font-size: 26rpx;
  1765. }
  1766. }
  1767. }
  1768. .order-bd {
  1769. display: flex;
  1770. padding: 0 0;
  1771. .order-item {
  1772. display: flex;
  1773. flex-direction: column;
  1774. justify-content: center;
  1775. align-items: center;
  1776. width: 20%;
  1777. height: 140rpx;
  1778. .pic {
  1779. position: relative;
  1780. text-align: center;
  1781. .iconfont {
  1782. font-size: 48rpx;
  1783. color: var(--view-theme);
  1784. }
  1785. image {
  1786. width: 58rpx;
  1787. height: 48rpx;
  1788. }
  1789. }
  1790. .txt {
  1791. margin-top: 6rpx;
  1792. font-size: 26rpx;
  1793. color: #454545;
  1794. }
  1795. }
  1796. }
  1797. }
  1798. }
  1799. .slider-wrapper {
  1800. margin: 20rpx 30rpx;
  1801. height: 130rpx;
  1802. swiper,
  1803. swiper-item {
  1804. height: 100%;
  1805. }
  1806. image {
  1807. width: 100%;
  1808. height: 130rpx;
  1809. border-radius: 16rpx;
  1810. }
  1811. }
  1812. .user-menus {
  1813. background-color: #fff;
  1814. margin: 0 30rpx;
  1815. border-radius: 16rpx;
  1816. .menu-title {
  1817. padding: 30rpx 30rpx 40rpx;
  1818. font-size: 30rpx;
  1819. color: #282828;
  1820. font-weight: bold;
  1821. }
  1822. .list-box {
  1823. display: flex;
  1824. flex-wrap: wrap;
  1825. padding: 0;
  1826. }
  1827. .item {
  1828. position: relative;
  1829. display: flex;
  1830. align-items: center;
  1831. justify-content: space-between;
  1832. flex-direction: column;
  1833. width: 25%;
  1834. margin-bottom: 47rpx;
  1835. font-size: 26rpx;
  1836. color: #333333;
  1837. image {
  1838. width: 52rpx;
  1839. height: 52rpx;
  1840. margin-bottom: 18rpx;
  1841. }
  1842. &:last-child::before {
  1843. display: none;
  1844. }
  1845. }
  1846. button {
  1847. font-size: 28rpx;
  1848. }
  1849. }
  1850. .phone {
  1851. color: #fff;
  1852. background-color: #CCC;
  1853. border-radius: 15px;
  1854. width: max-content;
  1855. padding: 0 10px;
  1856. }
  1857. .order-status-num {
  1858. min-width: 12rpx;
  1859. background-color: #fff;
  1860. color: var(--view-theme);
  1861. border-radius: 15px;
  1862. position: absolute;
  1863. right: -14rpx;
  1864. top: -15rpx;
  1865. font-size: 20rpx;
  1866. padding: 0 8rpx;
  1867. border: 1px solid var(--view-theme);
  1868. }
  1869. .support {
  1870. width: 219rpx;
  1871. height: 74rpx;
  1872. margin: 54rpx auto;
  1873. display: block;
  1874. }
  1875. .copyRightImg {
  1876. width: 219rpx;
  1877. height: 74rpx;
  1878. margin: 16rpx auto;
  1879. display: block;
  1880. }
  1881. .copy_right {
  1882. text-align: center;
  1883. color: #ccc;
  1884. font-size: 22rpx;
  1885. margin-top: 40rpx;
  1886. .copyRightText {
  1887. margin-top: 0rpx;
  1888. color: #ccc;
  1889. font-size: 20rpx;
  1890. margin-bottom: 20rpx;
  1891. }
  1892. }
  1893. }
  1894. .card-vip {
  1895. display: flex;
  1896. justify-content: space-between;
  1897. position: relative;
  1898. width: 690rpx;
  1899. height: 125rpx;
  1900. margin: -72rpx auto 0;
  1901. background: url('~@/static/images/user_vip.png');
  1902. background-size: cover;
  1903. padding: 28rpx 30rpx 0 92rpx;
  1904. &.on{
  1905. .left-box{
  1906. color: #fff;
  1907. }
  1908. .btn{
  1909. color: #fff;
  1910. }
  1911. .iconfont{
  1912. color: #fff;
  1913. }
  1914. }
  1915. .left-box {
  1916. font-size: 28rpx;
  1917. color: #AE5A2A;
  1918. .big {
  1919. font-size: 28rpx;
  1920. }
  1921. .small {
  1922. opacity: 0.8;
  1923. }
  1924. }
  1925. .btn {
  1926. color: #AE5A2A;
  1927. font-weight: 400;
  1928. font-size: 26rpx;
  1929. }
  1930. .iconfont {
  1931. font-size: 20rpx;
  1932. margin: 4rpx 0 0 4rpx;
  1933. color: #AE5A2A;
  1934. }
  1935. }
  1936. .setting {
  1937. margin-top: 15rpx;
  1938. margin-left: 15rpx;
  1939. color: #fff;
  1940. .iconfont {
  1941. font-size: 40rpx;
  1942. }
  1943. }
  1944. .new-users {
  1945. padding-bottom: 0;
  1946. padding-bottom: constant(safe-area-inset-bottom);
  1947. padding-bottom: env(safe-area-inset-bottom);
  1948. }
  1949. </style>