index.vue 8.2 KB

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