index.vue 6.9 KB

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