index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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.navigateBack({
  177. delta:-1
  178. })
  179. }else{
  180. }
  181. }
  182. })
  183. },
  184. // 跳转页面
  185. navgetTo(url) {
  186. this.utils.isLogin().then(res => {
  187. if(res){
  188. uni.navigateTo({
  189. url: url
  190. })
  191. }
  192. })
  193. },
  194. }
  195. }
  196. </script>
  197. <style lang="scss">
  198. .content{
  199. margin: 20upx 0upx;
  200. padding: 0 20upx;
  201. .user-info{
  202. padding: 30upx;
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. .left{
  207. position: relative;
  208. display: flex;
  209. .head-img{
  210. width: 120upx;
  211. height: 120upx;
  212. border-radius: 50%;
  213. overflow: hidden;
  214. margin-right: 30upx;
  215. border: 4upx solid #FFFFFF;
  216. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  217. image{
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. .name-phone{
  223. padding-top: 15upx;
  224. .name{
  225. font-size: 36upx;
  226. font-family: PingFang SC;
  227. font-weight: bold;
  228. color: #111111;
  229. line-height: 1;
  230. }
  231. .phone{
  232. font-size: 28upx;
  233. font-family: PingFang SC;
  234. font-weight: 500;
  235. color: #666666;
  236. line-height: 1;
  237. margin-top: 30upx;
  238. }
  239. }
  240. }
  241. .msg-box{
  242. padding: 5rpx 15upx;
  243. height: 30upx;
  244. line-height: 30upx;
  245. font-size: 22upx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #FFFFFF;
  249. border-radius: 8rpx;
  250. background-color: #2BC7B9;
  251. }
  252. }
  253. .used-tools{
  254. box-sizing: border-box;
  255. background: #FFFFFF;
  256. border-radius: 16upx;
  257. padding: 40upx 30upx;
  258. .title{
  259. font-size: 32upx;
  260. font-family: PingFang SC;
  261. font-weight: bold;
  262. color: #222222;
  263. line-height: 1;
  264. }
  265. .tools-list{
  266. margin-top: 50upx;
  267. display: flex;
  268. flex-wrap: wrap;
  269. width: 100%;
  270. .item{
  271. box-sizing: border-box;
  272. width: 25%;
  273. display: flex;
  274. flex-direction: column;
  275. align-items: center;
  276. justify-content: center;
  277. margin-bottom: 50upx;
  278. position: relative;
  279. image{
  280. width: 44upx;
  281. height: 44upx;
  282. }
  283. .text{
  284. font-size: 24upx;
  285. font-family: PingFang SC;
  286. font-weight: 500;
  287. color: #111111;
  288. line-height: 1;
  289. margin-top: 20upx;
  290. }
  291. .contact-btn{
  292. display: inline-block;
  293. position: absolute;
  294. top: 0;
  295. left: 0;
  296. width: 100%;
  297. height: 100%;
  298. opacity: 0;
  299. }
  300. }
  301. }
  302. }
  303. .log-out{
  304. height: 80upx;
  305. line-height: 80upx;
  306. text-align: center;
  307. font-size: 26upx;
  308. font-family: PingFang SC;
  309. font-weight: 500;
  310. color: #666666;
  311. background: #FFFFFF;
  312. border-radius: 16upx;
  313. margin-top: 20upx;
  314. }
  315. }
  316. </style>