环卫车小程序前端代码
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.

301 lines
9.1 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
  1. <template>
  2. <view class="u-page">
  3. <view class="se-pt-50 se-pb-40 se-px-40 se-bgc-green se-c-white se-pos">
  4. <view class="se-flex">
  5. <image :src="user.headImage" class="se-br-p-50 se-w-100 se-h-100 se-bgc-f5" mode=""></image>
  6. <view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
  7. <view class="se-flex">
  8. <text class="se-fw-6 se-fs-30">{{user.nickName}}</text>
  9. <view class="se-flex se-flex-ai-c se-ml-20" @click="toNav()">
  10. <image class="se-a-25 se-mr-10" src="@/static/image/pencil.png" mode=""></image>
  11. <text class="se-fs-22">修改资料</text>
  12. </view>
  13. </view>
  14. <view class="se-fs-24 se-display-ib">
  15. <text>手机号:</text>
  16. <text class="se-ml-20">{{user.phone}}</text>
  17. </view>
  18. <view class="se-fs-24 se-display-ib">
  19. <text class="se-tag se-bgc-gray" v-if="companyAuthenticationStatus==2">企业认证-未通过</text>
  20. <text class="se-tag se-bgc-blue" v-if="companyAuthenticationStatus==1">企业认证-已通过</text>
  21. <text class="se-tag se-bgc-red" v-if="companyAuthenticationStatus==0">企业认证-审核中</text>
  22. <text class="se-tag se-bgc-gray" v-if="personAuthenticationStatus==2">个人认证-未通过</text>
  23. <text class="se-tag se-bgc-blue" v-if="personAuthenticationStatus==1">个人认证-已通过</text>
  24. <text class="se-tag se-bgc-red" v-if="personAuthenticationStatus==0">个人认证-审核中</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="se-m-30 se-mt-30 se-pl-30 se-pr-20 se-br-20 se-bgc-white">
  30. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onIdentity()">
  31. <view class="se-flex se-flex-ai-c">
  32. <image class="se-a-30" src="@/static/image/482012.png" mode=""></image>
  33. <text class="se-ml-20 se-fs-24 se-fw-5">实名认证</text>
  34. </view>
  35. <view class="se-flex se-flex-ai-c">
  36. <u-icon name="arrow-right"></u-icon>
  37. </view>
  38. </view>
  39. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onReservation()">
  40. <view class="se-flex se-flex-ai-c">
  41. <image class="se-a-30" src="@/static/image/482011.png" mode=""></image>
  42. <text class="se-ml-20 se-fs-24 se-fw-5">预约信息</text>
  43. </view>
  44. <view class="se-flex se-flex-ai-c">
  45. <u-icon name="arrow-right"></u-icon>
  46. </view>
  47. </view>
  48. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onRelease()">
  49. <view class="se-flex se-flex-ai-c">
  50. <image class="se-a-30" src="@/static/image/482014.png" mode=""></image>
  51. <text class="se-ml-20 se-fs-24 se-fw-5">我的发布</text>
  52. </view>
  53. <view class="se-flex se-flex-ai-c">
  54. <u-icon name="arrow-right"></u-icon>
  55. </view>
  56. </view>
  57. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onApply()">
  58. <view class="se-flex se-flex-ai-c">
  59. <image class="se-a-30" src="@/static/image/482013.png" mode=""></image>
  60. <text class="se-ml-20 se-fs-24 se-fw-5">我的寻车申请</text>
  61. </view>
  62. <view class="se-flex se-flex-ai-c">
  63. <u-icon name="arrow-right"></u-icon>
  64. </view>
  65. </view>
  66. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onInvite()">
  67. <view class="se-flex se-flex-ai-c">
  68. <image class="se-a-30" src="@/static/image/482012.png" mode=""></image>
  69. <text class="se-ml-20 se-fs-24 se-fw-5">我的邀请</text>
  70. </view>
  71. <view class="se-flex se-flex-ai-c">
  72. <u-icon name="arrow-right"></u-icon>
  73. </view>
  74. </view>
  75. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onRecommend()">
  76. <view class="se-flex se-flex-ai-c">
  77. <image class="se-a-30" src="@/static/image/482012.png" mode=""></image>
  78. <text class="se-ml-20 se-fs-24 se-fw-5">我的推荐</text>
  79. </view>
  80. <view class="se-flex se-flex-ai-c">
  81. <u-icon name="arrow-right"></u-icon>
  82. </view>
  83. </view>
  84. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onCustomerService()">
  85. <view class="se-flex se-flex-ai-c">
  86. <image class="se-a-30" src="@/static/image/470868.png" mode=""></image>
  87. <text class="se-ml-20 se-fs-24 se-fw-5">在线客服</text>
  88. </view>
  89. <view class="se-flex se-flex-ai-c">
  90. <u-icon name="arrow-right"></u-icon>
  91. </view>
  92. </view>
  93. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-b" @click="onVersion()">
  94. <view class="se-flex se-flex-ai-c">
  95. <image class="se-a-30" src="@/static/image/470868.png" mode=""></image>
  96. <text class="se-ml-20 se-fs-24 se-fw-5">关于我们</text>
  97. </view>
  98. <view class="se-flex se-flex-ai-c">
  99. <u-icon name="arrow-right"></u-icon>
  100. </view>
  101. </view>
  102. <view class="se-py-30 se-px-20 se-flex se-flex-h-sb" @click="onLogOut()">
  103. <view class="se-flex se-flex-ai-c">
  104. <text class="se-fs-24 se-fw-5">退出登录</text>
  105. </view>
  106. <view class="se-flex se-flex-ai-c">
  107. <u-icon name="arrow-right"></u-icon>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </template>
  113. <script>
  114. import { getInfo,queryPhone } from "@/common/api.js"
  115. export default {
  116. data() {
  117. return {
  118. user:{},
  119. phone:"",
  120. companyAuthenticationStatus:null,
  121. personAuthenticationStatus:null,
  122. }
  123. },
  124. onLoad() {
  125. },
  126. onShow() {
  127. this.onUserInfo()
  128. this.onQueryPhone()
  129. },
  130. methods: {
  131. onUserInfo(){
  132. let that = this
  133. getInfo({id:uni.getStorageSync('userInfo').id}).then(response=>{
  134. console.info('resultresult',response)
  135. that.user = response.result.memberInfo
  136. that.companyAuthenticationStatus = response.result.companyAuthenticationStatus
  137. that.personAuthenticationStatus = response.result.personAuthenticationStatus
  138. uni.setStorageSync('userInfo', response.result.memberInfo)
  139. uni.setStorageSync("companyAuthenticationStatus",response.result.companyAuthenticationStatus)
  140. uni.setStorageSync("personAuthenticationStatus",response.result.personAuthenticationStatus)
  141. }).catch(err=>{})
  142. },
  143. onQueryPhone(){
  144. queryPhone({}).then(response=>{
  145. this.phone = response.result.paramValue
  146. }).catch(error=>{
  147. })
  148. },
  149. // 实名认证
  150. onIdentity(){
  151. uni.navigateTo({
  152. url:"/pages/identity/index?userStatus=1"
  153. })
  154. },
  155. onInvite(){
  156. uni.navigateTo({
  157. url:"/pages_subpack/invite/index"
  158. })
  159. },
  160. onRecommend(){
  161. uni.navigateTo({
  162. url:"/pages_subpack/recommend/index"
  163. })
  164. },
  165. onRelease(){
  166. let that = this
  167. if (that.companyAuthenticationStatus == 1){
  168. uni.navigateTo({
  169. url:"/pages_subpack/release/list"
  170. })
  171. }else{
  172. uni.showModal({
  173. title:"未企业认证",
  174. showCancel:false,
  175. content:"立即前往认证",
  176. success() {
  177. that.onIdentity()
  178. }
  179. })
  180. }
  181. },
  182. onApply(){
  183. let that = this
  184. if (that.companyAuthenticationStatus == 1 || that.personAuthenticationStatus == 1){
  185. uni.navigateTo({
  186. url:"/pages_subpack/apply/list"
  187. })
  188. }else{
  189. uni.showModal({
  190. title:"未实名认证",
  191. showCancel:false,
  192. content:"立即前往实名认证",
  193. success() {
  194. that.onIdentity()
  195. }
  196. })
  197. }
  198. },
  199. onSystem(){
  200. uni.navigateTo({
  201. url:"/pages_subpack/system/index"
  202. })
  203. },
  204. onReservation(){
  205. let that = this
  206. if (that.companyAuthenticationStatus == 1 || that.personAuthenticationStatus == 1){
  207. uni.navigateTo({
  208. url:"/pages/reservation/index"
  209. })
  210. }else{
  211. uni.showModal({
  212. title:"未实名认证",
  213. showCancel:false,
  214. content:"立即前往实名认证",
  215. success() {
  216. that.onIdentity()
  217. }
  218. })
  219. }
  220. },
  221. onVersion(){
  222. uni.navigateTo({
  223. url:"/pages_subpack/version/index"
  224. })
  225. },
  226. onLogOut(){
  227. uni.showModal({
  228. title:"温馨提示",
  229. content:"确定退出当前登录",
  230. cancelText:"取消",
  231. confirmText:"确定",
  232. success:(res)=> {
  233. console.info(res)
  234. if(res.confirm==true){
  235. uni.removeStorageSync("userId")
  236. uni.removeStorageSync("shareId")
  237. uni.removeStorageSync("userInfo")
  238. uni.removeStorageSync("token")
  239. uni.removeStorageSync("sessionKey")
  240. uni.removeStorageSync("companyAuthenticationStatus")
  241. uni.removeStorageSync("personAuthenticationStatus")
  242. uni.navigateTo({
  243. url:"/pages/auth/index"
  244. })
  245. }
  246. }
  247. })
  248. },
  249. toNav(){
  250. uni.navigateTo({
  251. url:"/pages/login/index"
  252. })
  253. },
  254. onCustomerService(){
  255. let that = this
  256. // let obj = that.$utils.getkeyContent('phone')
  257. if (uni.canIUse('makePhoneCall')) {
  258. uni.makePhoneCall({
  259. phoneNumber: String(that.phone),
  260. success: function () {
  261. console.log('拨打电话成功');
  262. },
  263. fail: function () {
  264. console.log('拨打电话失败');
  265. }
  266. });
  267. } else {
  268. console.log('你的设备不支持拨打电话功能');
  269. }
  270. }
  271. }
  272. }
  273. </script>
  274. <style>
  275. page {
  276. background-color: #f5f5f5 !important;
  277. }
  278. .se-grid {
  279. display: grid;
  280. grid-template-columns: 1fr 1fr 1fr 1fr;
  281. gap: 10rpx;
  282. padding-bottom: 4rpx;
  283. }
  284. .se-tag{
  285. margin-right: 10rpx;
  286. margin-top: 5px;
  287. padding: 5rpx 10rpx;
  288. border-radius: 4rpx;
  289. border: 2rpx solid rgba(0,0,0,0.00);
  290. font-size: 16rpx;
  291. font-family: PingFang SC, PingFang SC-Bold;
  292. font-weight: 700;
  293. text-align: center;
  294. }
  295. </style>