index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="content">
  3. <view class="con_top_warp">
  4. <view class="con_top_right" @click="logOut" style="margin-top: 50px;">
  5. <image src="/static/img/logout.png" class="outimg" mode=""></image>
  6. </view>
  7. </view>
  8. <view class="topwarp">
  9. <view class="infowarp">
  10. <image :src="info.user_logo" class="infoimg" mode=""></image>
  11. <view class="infoname">{{info.user_name}}</view>
  12. </view>
  13. </view>
  14. <view class="tabwarp">
  15. <view class="tabli" @click="subServe">
  16. <image src="/static/img/icon1.png" class="tabimg" mode=""></image>
  17. <view class="tabtext">{{i18n['提交服务']}}</view>
  18. </view>
  19. <view class="tabli" @click="toProcess">
  20. <image src="/static/img/icon2.png" class="tabimg" mode=""></image>
  21. <view class="tabtext">{{i18n['查看进度']}}</view>
  22. </view>
  23. <view class="tabli" @click="toEvaluate">
  24. <image src="/static/img/icon3.png" class="tabimg" mode=""></image>
  25. <view class="tabtext">{{i18n['服务评价']}}</view>
  26. </view>
  27. <view class="tabli" @click="toKnowledge">
  28. <image src="/static/img/icon5.png" class="tabimg" mode=""></image>
  29. <view class="tabtext">{{i18n['知识库']}}</view>
  30. </view>
  31. </view>
  32. <view class="companyInfo">
  33. <view class="companyli" @click="toCall">
  34. <image src="/static/img/phone.png" class="phoneimg" mode=""></image>
  35. {{info.user_phone?info.user_phone:''}}
  36. </view>
  37. <view class="companyli">
  38. <image src="/static/img/email.png" class="phoneimg" mode=""></image>
  39. {{info.user_email ? info.user_email : ''}}
  40. </view>
  41. <view class="companyli" @click="toAddress">
  42. <image src="/static/img/address.png" style="height:54rpx" class="phoneimg" mode=""></image>
  43. {{info.user_address?info.user_address:''}}
  44. </view>
  45. <view class="companyli" @click="scanCode">
  46. <image src="/static/img/qqrcode.png" style="height:54rpx" class="phoneimg" mode=""></image>
  47. 扫一扫
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import { netCompanyInfo, netInfo, netLogOut } from '@/api/api.js'
  54. export default {
  55. data() {
  56. return {
  57. info:{},
  58. isChinese:false
  59. }
  60. },
  61. onLoad() {
  62. },
  63. computed:{
  64. i18n() {
  65. return this.$t("index")
  66. }
  67. },
  68. onLoad() {
  69. },
  70. onShow() {
  71. console.log(uni.getStorageSync('locale') == 'zh')
  72. this.isChinese = !uni.getStorageSync('locale') || uni.getStorageSync('locale') == 'zh' ? true : false
  73. this.getInfo()
  74. },
  75. methods: {
  76. //退出 登录
  77. logOut() {
  78. uni.showModal({
  79. title:this.i18n['提示'],
  80. content:this.i18n['请确认是否退出登录?'],
  81. success:(res)=>{
  82. if(res.confirm){
  83. netLogOut().then(res=>{
  84. uni.removeStorageSync('token')
  85. uni.redirectTo({
  86. url:'/pages/login/index'
  87. })
  88. })
  89. }
  90. }
  91. })
  92. },
  93. // 扫码
  94. scanCode() {
  95. // #ifdef MP-WEIXIN
  96. // 允许从相机和相册扫码
  97. uni.scanCode({
  98. scanType: ["qrCode"],
  99. success: (res) => {
  100. if (res.result) {
  101. const val = res.result;
  102. console.log(val)
  103. uni.navigateTo({
  104. url:'/pages/index/qrcode?id='+val
  105. })
  106. } else {
  107. console.log('请重新扫描');
  108. return false;
  109. }
  110. },
  111. fail: (res) => {
  112. console.log('未识别到二维码');
  113. }
  114. })
  115. // #endif
  116. },
  117. changeLan(item) {
  118. this.isChinese = !this.isChinese
  119. this.$i18n.locale = item
  120. uni.setStorageSync('locale', item)
  121. },
  122. toCall() {
  123. uni.makePhoneCall({
  124. phoneNumber: this.info.user_phone
  125. })
  126. },
  127. toAddress() {
  128. uni.openLocation({
  129. latitude:this.info.user_lat,
  130. longitude:this.info.user_lag,
  131. })
  132. },
  133. getInfo() {
  134. netInfo().then(res=>{
  135. this.info = res.data
  136. uni.setNavigationBarTitle({
  137. title: res.data.user_name
  138. })
  139. })
  140. },
  141. toLogin() {
  142. uni.navigateTo({
  143. url:'/pages/login/index'
  144. })
  145. },
  146. subServe() {
  147. uni.navigateTo({
  148. url:'/pages/submit_server/index'
  149. })
  150. },
  151. //查看进度
  152. toProcess() {
  153. uni.navigateTo({
  154. url:'/pages/see_progress/index'
  155. })
  156. },
  157. //评价
  158. toEvaluate() {
  159. uni.navigateTo({
  160. url:'/pages/evaluate/index'
  161. })
  162. },
  163. //知识库
  164. toKnowledge() {
  165. uni.navigateTo({
  166. url:'/pages/knowledge_base/list'
  167. })
  168. },
  169. //服务商城
  170. toServiceMall() {
  171. uni.navigateTo({
  172. url:'/pages/serviceMall/index'
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .content{
  180. position: relative;
  181. background: linear-gradient(180deg, #DFF0FF 0%, #F4F4F4 100%);
  182. .con_top_warp{
  183. display: flex;
  184. justify-content: flex-end;
  185. align-items: center;
  186. position: absolute;
  187. top:30rpx;
  188. left:0;
  189. z-index: 1;
  190. width:100%;
  191. padding:0 45rpx;
  192. .langbox{
  193. .lanimg{
  194. width:44rpx;
  195. height:44rpx;
  196. }
  197. }
  198. .con_top_right{
  199. width:43rpx;
  200. height:43rpx;
  201. border-radius: 50%;
  202. .outimg{
  203. width:43rpx;
  204. height:43rpx;
  205. border-radius: 50%;
  206. }
  207. }
  208. }
  209. }
  210. .topwarp{
  211. width:750rpx;
  212. padding-top:80rpx;
  213. position: relative;
  214. .infowarp{
  215. text-align: center;
  216. .infoimg{
  217. width:160rpx;
  218. height:160rpx;
  219. border-radius: 50%;
  220. margin:0 auto 15rpx;
  221. }
  222. .infoname{
  223. font-size:30rpx;
  224. color:#666;
  225. }
  226. }
  227. }
  228. .tabwarp{
  229. width:690rpx;
  230. background:#fff;
  231. border-radius: 20rpx;
  232. padding:30rpx;
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. margin:80rpx auto 0;
  237. .tabli{
  238. flex-shrink: 0;
  239. text-align: center;
  240. width:100rpx;
  241. .tabimg{
  242. width:80rpx;
  243. height:80rpx;
  244. margin-bottom:15rpx;
  245. }
  246. .tabtext{
  247. font-size:24rpx;
  248. color:#333;
  249. }
  250. }
  251. }
  252. .companyInfo{
  253. width:690rpx;
  254. background:#fff;
  255. border-radius: 20rpx;
  256. padding:0 30rpx;
  257. margin:30rpx auto 0;
  258. .companyli{
  259. display: flex;
  260. justify-content: flex-start;
  261. align-items: center;
  262. padding:24rpx 0;
  263. border-bottom:1rpx solid #EDEDED;
  264. font-size:24rpx;
  265. color:#666;
  266. .phoneimg{
  267. width:50rpx;
  268. height:50rpx;
  269. margin-right:15rpx;
  270. }
  271. }
  272. }
  273. </style>