index.vue 6.6 KB

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