index.vue 7.6 KB

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