index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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}}
  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://cdhyt-1383856587.cos.ap-chengdu.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://cdhyt-1383856587.cos.ap-chengdu.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://cdhyt-1383856587.cos.ap-chengdu.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://cdhyt-1383856587.cos.ap-chengdu.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://cdhyt-1383856587.cos.ap-chengdu.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://cdhyt-1383856587.cos.ap-chengdu.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://cdhyt-1383856587.cos.ap-chengdu.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="navTo('/pages_company/voice')">
  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="navTo('/pages_company/voiceList')">
  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. toPaywechat(){
  85. uni.navigateTo({
  86. url:'/pages_company/wechatcode?companyId='+this.user.companyId
  87. })
  88. },
  89. alipay(){
  90. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  91. // uni.setClipboardData({
  92. // data:url,
  93. // success:()=>{
  94. // uni.showToast({
  95. // title:'收款地址已复制到剪切板',
  96. // icon:'none'
  97. // })
  98. // }
  99. // });
  100. uni.navigateTo({
  101. url:'/pages_company/alipayImg'
  102. })
  103. },
  104. navTo(url){
  105. uni.navigateTo({
  106. url:url
  107. })
  108. },
  109. toCard(){
  110. uni.navigateTo({
  111. url:'/pages_company/card?cardId='+this.user.cardId
  112. })
  113. },
  114. toCreateOrder(){
  115. uni.navigateTo({
  116. url:'/pages_company/order/productList'
  117. })
  118. },
  119. toPay(){
  120. uni.navigateTo({
  121. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  122. })
  123. },
  124. toOrder(){
  125. uni.navigateTo({
  126. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  127. })
  128. },
  129. toPackage(){
  130. uni.navigateTo({
  131. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  132. })
  133. },
  134. toCoupon(){
  135. uni.navigateTo({
  136. url:'/pages_company/coupon'
  137. })
  138. },
  139. toCreateCoupon(){
  140. uni.navigateTo({
  141. url:'/pages_company/order/coupon'
  142. })
  143. },
  144. toCreateOrderCoupon(){
  145. uni.navigateTo({
  146. url:'/pages_company/order/coupon'
  147. })
  148. },
  149. getUserInfo(){
  150. var data={token:uni.getStorageSync('CompanyUserToken')}
  151. getUserInfo(data).then(
  152. res => {
  153. if(res.code==200){
  154. this.user=res.data;
  155. }
  156. else if(res.code==403){
  157. uni.setStorageSync('CompanyUserToken',null);
  158. uni.navigateBack({
  159. delta:-1
  160. })
  161. }else{
  162. uni.showToast({
  163. icon:'none',
  164. title: res.msg,
  165. });
  166. }
  167. },
  168. rej => {}
  169. );
  170. },
  171. logout(){
  172. uni.showModal({
  173. title:"提示",
  174. content:"确认退出登录吗?",
  175. showCancel:true,
  176. cancelText:'取消',
  177. confirmText:'确定',
  178. success:res=>{
  179. if(res.confirm){
  180. uni.setStorageSync('CompanyUserToken',null);
  181. uni.navigateBack({
  182. delta:-1
  183. })
  184. }else{
  185. }
  186. }
  187. })
  188. },
  189. // 跳转页面
  190. navgetTo(url) {
  191. this.utils.isLogin().then(res => {
  192. if(res){
  193. uni.navigateTo({
  194. url: url
  195. })
  196. }
  197. })
  198. },
  199. }
  200. }
  201. </script>
  202. <style lang="scss">
  203. .content{
  204. margin: 20upx 0upx;
  205. padding: 0 20upx;
  206. .user-info{
  207. padding: 30upx;
  208. display: flex;
  209. align-items: center;
  210. justify-content: space-between;
  211. .left{
  212. position: relative;
  213. display: flex;
  214. .head-img{
  215. width: 120upx;
  216. height: 120upx;
  217. border-radius: 50%;
  218. overflow: hidden;
  219. margin-right: 30upx;
  220. border: 4upx solid #FFFFFF;
  221. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  222. image{
  223. width: 100%;
  224. height: 100%;
  225. }
  226. }
  227. .name-phone{
  228. padding-top: 15upx;
  229. .name{
  230. font-size: 36upx;
  231. font-family: PingFang SC;
  232. font-weight: bold;
  233. color: #111111;
  234. line-height: 1;
  235. }
  236. .phone{
  237. font-size: 28upx;
  238. font-family: PingFang SC;
  239. font-weight: 500;
  240. color: #666666;
  241. line-height: 1;
  242. margin-top: 30upx;
  243. }
  244. }
  245. }
  246. .msg-box{
  247. padding: 5rpx 15upx;
  248. height: 30upx;
  249. line-height: 30upx;
  250. font-size: 22upx;
  251. font-family: PingFang SC;
  252. font-weight: 500;
  253. color: #FFFFFF;
  254. border-radius: 8rpx;
  255. background-color: #2BC7B9;
  256. }
  257. }
  258. .used-tools{
  259. box-sizing: border-box;
  260. background: #FFFFFF;
  261. border-radius: 16upx;
  262. padding: 40upx 30upx;
  263. .title{
  264. font-size: 32upx;
  265. font-family: PingFang SC;
  266. font-weight: bold;
  267. color: #222222;
  268. line-height: 1;
  269. }
  270. .tools-list{
  271. margin-top: 50upx;
  272. display: flex;
  273. flex-wrap: wrap;
  274. width: 100%;
  275. .item{
  276. box-sizing: border-box;
  277. width: 25%;
  278. display: flex;
  279. flex-direction: column;
  280. align-items: center;
  281. justify-content: center;
  282. margin-bottom: 50upx;
  283. position: relative;
  284. image{
  285. width: 44upx;
  286. height: 44upx;
  287. }
  288. .text{
  289. font-size: 24upx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #111111;
  293. line-height: 1;
  294. margin-top: 20upx;
  295. }
  296. .contact-btn{
  297. display: inline-block;
  298. position: absolute;
  299. top: 0;
  300. left: 0;
  301. width: 100%;
  302. height: 100%;
  303. opacity: 0;
  304. }
  305. }
  306. }
  307. }
  308. .log-out{
  309. height: 80upx;
  310. line-height: 80upx;
  311. text-align: center;
  312. font-size: 26upx;
  313. font-family: PingFang SC;
  314. font-weight: 500;
  315. color: #666666;
  316. background: #FFFFFF;
  317. border-radius: 16upx;
  318. margin-top: 20upx;
  319. }
  320. }
  321. </style>