index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{utils.parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" v-if="user.deptName">
  12. {{user.deptName}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <view class="item" @click="toCreateOrder()">
  20. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/order.png"
  21. mode=""></image>
  22. <text class="text">商品制单</text>
  23. </view>
  24. <view class="item" @click="toCreateCoupon()">
  25. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/icon_coupon.png"
  26. mode=""></image>
  27. <text class="text">制单优惠券</text>
  28. </view>
  29. <view class="item" @click="toPay()">
  30. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/money.png"
  31. mode=""></image>
  32. <text class="text">微信收款</text>
  33. </view>
  34. <!-- <view class="item" @click="alipay()">
  35. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/money.png" mode=""></image>
  36. <text class="text">支付宝收款</text>
  37. </view> -->
  38. <view class="item" @click="toOrder()">
  39. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/order.png"
  40. mode=""></image>
  41. <text class="text">我的订单</text>
  42. </view>
  43. <view class="item" @click="toPackage()">
  44. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/package.png"
  45. mode=""></image>
  46. <text class="text">商品套餐</text>
  47. </view>
  48. <view class="item" @click="toCoupon()">
  49. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/icon_coupon.png"
  50. mode=""></image>
  51. <text class="text">套餐优惠券</text>
  52. </view>
  53. <view class="item" @click="toPaywechat()">
  54. <image src="https://kuanyitang-1317640934.cos.ap-shanghai.myqcloud.com/app/image/wechat.png"
  55. mode=""></image>
  56. <text class="text">微信收款码</text>
  57. </view>
  58. <!-- <view class="item" @click="navTo('/pages_company/voice')">
  59. <u-icon name="mic" size="28"></u-icon>
  60. <view class="text">声音录制</view>
  61. </view>
  62. <view class="item" @click="navTo('/pages_company/voiceList')">
  63. <u-icon name="mic" size="28"></u-icon>
  64. <view class="text">声音采集</view>
  65. </view> -->
  66. <view class="item" @click="toShareLive()">
  67. <image :src="imgPath+ '/userapp/images/live_icon.png'" mode=""></image>
  68. <text class="text">分享直播间</text>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 退出登录按钮 -->
  73. <view class="log-out" @click="logout">退出登录</view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import {
  79. getUserInfo,
  80. getQrImg
  81. } from '@/api/companyUser'
  82. export default {
  83. data() {
  84. return {
  85. imgPath: this.$store.state.imgpath,
  86. user: null,
  87. };
  88. },
  89. onLoad() {
  90. console.log("onload")
  91. },
  92. onShow() {
  93. console.log("onshow")
  94. this.getUserInfo()
  95. },
  96. methods: {
  97. toShareLive() {
  98. uni.navigateTo({
  99. url: '/pages_company/shareLive?companyId=' + this.user.companyId + "&companyUserId=" + this
  100. .user.userId
  101. })
  102. },
  103. toPaywechat() {
  104. uni.navigateTo({
  105. url: '/pages_company/wechatcode?companyId=' + this.user.companyId
  106. })
  107. },
  108. alipay() {
  109. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  110. // uni.setClipboardData({
  111. // data:url,
  112. // success:()=>{
  113. // uni.showToast({
  114. // title:'收款地址已复制到剪切板',
  115. // icon:'none'
  116. // })
  117. // }
  118. // });
  119. uni.navigateTo({
  120. url: '/pages_company/alipayImg'
  121. })
  122. },
  123. navTo(url) {
  124. uni.navigateTo({
  125. url: url
  126. })
  127. },
  128. toCard() {
  129. uni.navigateTo({
  130. url: '/pages_company/card?cardId=' + this.user.cardId
  131. })
  132. },
  133. toCreateOrder() {
  134. uni.navigateTo({
  135. url: '/pages_company/order/productList?companyId=' + this.user.companyId + "&companyUserId=" + this.user.userId
  136. })
  137. },
  138. toPay() {
  139. uni.navigateTo({
  140. url: '/pages_user/user/pay?companyId=' + this.user.companyId + "&companyUserId=" + this.user
  141. .userId
  142. })
  143. },
  144. toOrder() {
  145. uni.navigateTo({
  146. url: '/pages_company/storeOrder?companyId=' + this.user.companyId + "&companyUserId=" + this
  147. .user.userId
  148. })
  149. },
  150. toPackage() {
  151. uni.navigateTo({
  152. url: '/pages_company/storeProductPackage?companyId=' + this.user.companyId +
  153. "&companyUserId=" + this.user.userId
  154. })
  155. },
  156. toCoupon() {
  157. uni.navigateTo({
  158. url: '/pages_company/coupon'
  159. })
  160. },
  161. toCreateCoupon() {
  162. uni.navigateTo({
  163. url: '/pages_company/order/coupon'
  164. })
  165. },
  166. toCreateOrderCoupon() {
  167. uni.navigateTo({
  168. url: '/pages_company/order/coupon'
  169. })
  170. },
  171. getUserInfo() {
  172. var data = {
  173. token: uni.getStorageSync('CompanyUserToken')
  174. }
  175. getUserInfo(data).then(
  176. res => {
  177. if (res.code == 200) {
  178. this.user = res.data;
  179. } else if (res.code == 403) {
  180. uni.setStorageSync('CompanyUserToken', null);
  181. uni.navigateBack({
  182. delta: -1
  183. })
  184. } else {
  185. uni.showToast({
  186. icon: 'none',
  187. title: res.msg,
  188. });
  189. }
  190. },
  191. rej => {}
  192. );
  193. },
  194. logout() {
  195. uni.showModal({
  196. title: "提示",
  197. content: "确认退出登录吗?",
  198. showCancel: true,
  199. cancelText: '取消',
  200. confirmText: '确定',
  201. success: res => {
  202. if (res.confirm) {
  203. uni.setStorageSync('CompanyUserToken', null);
  204. uni.navigateBack({
  205. delta: -1
  206. })
  207. } else {}
  208. }
  209. })
  210. },
  211. // 跳转页面
  212. navgetTo(url) {
  213. this.utils.isLogin().then(res => {
  214. if (res) {
  215. uni.navigateTo({
  216. url: url
  217. })
  218. }
  219. })
  220. },
  221. }
  222. }
  223. </script>
  224. <style lang="scss">
  225. .content {
  226. margin: 20upx 0upx;
  227. padding: 0 20upx;
  228. .user-info {
  229. padding: 30upx;
  230. display: flex;
  231. align-items: center;
  232. justify-content: space-between;
  233. .left {
  234. position: relative;
  235. display: flex;
  236. .head-img {
  237. width: 120upx;
  238. height: 120upx;
  239. border-radius: 50%;
  240. overflow: hidden;
  241. margin-right: 30upx;
  242. border: 4upx solid #FFFFFF;
  243. box-shadow: 0px 5px 15px 2px rgba(0, 0, 0, 0.1);
  244. image {
  245. width: 100%;
  246. height: 100%;
  247. }
  248. }
  249. .name-phone {
  250. padding-top: 15upx;
  251. .name {
  252. font-size: 36upx;
  253. font-family: PingFang SC;
  254. font-weight: bold;
  255. color: #111111;
  256. line-height: 1;
  257. }
  258. .phone {
  259. font-size: 28upx;
  260. font-family: PingFang SC;
  261. font-weight: 500;
  262. color: #666666;
  263. line-height: 1;
  264. margin-top: 30upx;
  265. }
  266. }
  267. }
  268. .msg-box {
  269. padding: 5rpx 15upx;
  270. font-size: 22upx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. color: #FFFFFF;
  274. border-radius: 8rpx;
  275. background-color: #2BC7B9;
  276. }
  277. }
  278. .used-tools {
  279. box-sizing: border-box;
  280. background: #FFFFFF;
  281. border-radius: 16upx;
  282. padding: 40upx 30upx;
  283. .title {
  284. font-size: 32upx;
  285. font-family: PingFang SC;
  286. font-weight: bold;
  287. color: #222222;
  288. line-height: 1;
  289. }
  290. .tools-list {
  291. margin-top: 50upx;
  292. display: flex;
  293. flex-wrap: wrap;
  294. width: 100%;
  295. .item {
  296. box-sizing: border-box;
  297. width: 25%;
  298. display: flex;
  299. flex-direction: column;
  300. align-items: center;
  301. justify-content: center;
  302. margin-bottom: 50upx;
  303. position: relative;
  304. image {
  305. width: 44upx;
  306. height: 44upx;
  307. }
  308. .text {
  309. font-size: 24upx;
  310. font-family: PingFang SC;
  311. font-weight: 500;
  312. color: #111111;
  313. line-height: 1;
  314. margin-top: 20upx;
  315. }
  316. .contact-btn {
  317. display: inline-block;
  318. position: absolute;
  319. top: 0;
  320. left: 0;
  321. width: 100%;
  322. height: 100%;
  323. opacity: 0;
  324. }
  325. }
  326. }
  327. }
  328. .log-out {
  329. height: 80upx;
  330. line-height: 80upx;
  331. text-align: center;
  332. font-size: 26upx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #666666;
  336. background: #FFFFFF;
  337. border-radius: 16upx;
  338. margin-top: 20upx;
  339. }
  340. }
  341. </style>